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

Unified Diff: sky/sdk/lib/framework/layout2.dart

Issue 1160843005: Add hello_fn2.dart and make Text("Hello fn2") actually render something. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fixored Created 5 years, 7 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 | « sky/sdk/lib/framework/fn2.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/layout2.dart
diff --git a/sky/sdk/lib/framework/layout2.dart b/sky/sdk/lib/framework/layout2.dart
index ee76408115da6b7fbc8ccdd1e91d4b68fba5ab7d..2abb2a8e7d02bb9ab9988396fae89e8d5e04c8b0 100644
--- a/sky/sdk/lib/framework/layout2.dart
+++ b/sky/sdk/lib/framework/layout2.dart
@@ -968,14 +968,20 @@ class RenderFlex extends RenderDecoratedBox with ContainerRenderNodeMixin<Render
}
}
+class RenderInline extends RenderNode {
+ String data;
+
+ RenderInline(this.data);
+}
+
class RenderParagraph extends RenderDecoratedBox {
- final String text;
- LayoutRoot _layoutRoot = new LayoutRoot();
- Document _document;
+ String text;
+ sky.LayoutRoot _layoutRoot = new sky.LayoutRoot();
+ sky.Document _document;
RenderParagraph(String this.text) :
super(new BoxDecoration(backgroundColor: 0xFFFFFFFF)) {
- _document = new Document();
+ _document = new sky.Document();
_layoutRoot.rootElement = _document.createElement('p');
_layoutRoot.rootElement.appendChild(_document.createText(this.text));
}
@@ -983,9 +989,12 @@ class RenderParagraph extends RenderDecoratedBox {
void performLayout() {
_layoutRoot.maxWidth = constraints.maxWidth;
_layoutRoot.minWidth = constraints.minWidth;
+ _layoutRoot.minHeight = constraints.minHeight;
+ _layoutRoot.maxHeight = constraints.maxHeight;
_layoutRoot.layout();
width = _layoutRoot.rootElement.width;
- height = _layoutRoot.rootElement.height;
+ // TODO(eseidel): LayoutRoot will not expand to fill height. :(
+ height = _constraints.constrainHeight(_layoutRoot.rootElement.height);
}
void hitTestChildren(HitTestResult result, { double x, double y }) {
« no previous file with comments | « sky/sdk/lib/framework/fn2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698