Right-aligned text paints offscreen sometimes

We were assuming that the text extended from 0.0 to its max content width.
That's not correct for right-aligned text. Instead, we need to layout the text
again at the width we want it to occupy.
This commit is contained in:
Adam Barth
2015-10-26 15:49:47 -07:00
parent b1b47435e9
commit 69a0689a33
4 changed files with 20 additions and 21 deletions

View File

@@ -43,7 +43,7 @@ class Label extends Node {
_painter.minWidth = 0.0;
_painter.layout();
_width = _painter.maxContentWidth.ceil().toDouble();
_width = _painter.maxIntrinsicWidth.ceil().toDouble();
_painter.maxWidth = _width;
_painter.minWidth = _width;