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

Unified Diff: sky/examples/raw/render_paragraph.dart

Issue 1160013004: Implement RenderImage and Image for Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase again 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/examples/raw/interactive_flex.dart ('k') | sky/sdk/lib/framework/fn2.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/raw/render_paragraph.dart
diff --git a/sky/examples/raw/render_paragraph.dart b/sky/examples/raw/render_paragraph.dart
index e7e8f6c45374071cf2b6289427ed78427a4d1a6d..015759a02bb7d9f4c564a5631fc6aa13c0c69b31 100644
--- a/sky/examples/raw/render_paragraph.dart
+++ b/sky/examples/raw/render_paragraph.dart
@@ -8,30 +8,7 @@ import 'package:sky/framework/rendering/box.dart';
import 'package:sky/framework/rendering/node.dart';
import 'package:sky/framework/rendering/flex.dart';
import 'package:sky/framework/rendering/paragraph.dart';
-
-class RenderSolidColor extends RenderDecoratedBox {
- final Size desiredSize;
- final Color backgroundColor;
-
- RenderSolidColor(Color backgroundColor, { this.desiredSize: const Size.infinite() })
- : backgroundColor = backgroundColor,
- super(decoration: new BoxDecoration(backgroundColor: backgroundColor));
-
- Size getIntrinsicDimensions(BoxConstraints constraints) {
- return constraints.constrain(desiredSize);
- }
-
- void performLayout() {
- size = constraints.constrain(desiredSize);
- }
-
- void handlePointer(PointerEvent event) {
- if (event.type == 'pointerdown')
- decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000));
- else if (event.type == 'pointerup')
- decoration = new BoxDecoration(backgroundColor: backgroundColor);
- }
-}
+import '../lib/solid_color_box.dart';
AppView app;
@@ -43,7 +20,7 @@ void main() {
child: flexRoot
);
- RenderNode child = new RenderSolidColor(const Color(0xFFFFFF00));
+ RenderNode child = new RenderSolidColorBox(const Color(0xFFFFFF00));
flexRoot.add(child);
child.parentData.flex = 2;
« no previous file with comments | « sky/examples/raw/interactive_flex.dart ('k') | sky/sdk/lib/framework/fn2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698