Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1356)

Unified Diff: sky/sdk/lib/framework/rendering/paragraph.dart

Issue 1156383006: Make Text size to its content instead of always 100% width (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/rendering/paragraph.dart
diff --git a/sky/sdk/lib/framework/rendering/paragraph.dart b/sky/sdk/lib/framework/rendering/paragraph.dart
index 7f0ba175a66552c505916097b5622051850bced4..f266c337b01261d0f9871bd385dae1481d6c8d0a 100644
--- a/sky/sdk/lib/framework/rendering/paragraph.dart
+++ b/sky/sdk/lib/framework/rendering/paragraph.dart
@@ -52,7 +52,9 @@ class RenderParagraph extends RenderBox {
_layoutRoot.minHeight = constraints.minHeight;
_layoutRoot.maxHeight = constraints.maxHeight;
_layoutRoot.layout();
- size = constraints.constrain(new Size(_layoutRoot.rootElement.width, _layoutRoot.rootElement.height));
+ // rootElement.width always expands to fill, use maxContentWidth instead.
+ var root = _layoutRoot.rootElement;
+ size = constraints.constrain(new Size(root.maxContentWidth, root.height));
}
void paint(RenderObjectDisplayList canvas) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698