forked from firka/flutter
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user