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

Side by Side Diff: sky/examples/raw/sector-layout.dart

Issue 1153273002: Fix compilation errors in render-sector.dart (Closed) Base URL: https://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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 import 'package:sky/framework/app.dart'; 7 import 'package:sky/framework/app.dart';
8 import 'package:sky/framework/layout2.dart'; 8 import 'package:sky/framework/layout2.dart';
9 9
10 const double kTwoPi = 2 * math.PI; 10 const double kTwoPi = 2 * math.PI;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 result.add(this); 87 result.add(this);
88 return true; 88 return true;
89 } 89 }
90 void hitTestChildren(HitTestResult result, { double radius, double theta }) { } 90 void hitTestChildren(HitTestResult result, { double radius, double theta }) { }
91 91
92 double deltaRadius; 92 double deltaRadius;
93 double deltaTheta; 93 double deltaTheta;
94 } 94 }
95 95
96 class RenderDecoratedSector extends RenderSector { 96 class RenderDecoratedSector extends RenderSector {
97 BoxDecoration _decoration;
98 97
99 RenderDecoratedSector(BoxDecoration decoration) : _decoration = decoration; 98 RenderDecoratedSector(BoxDecoration decoration) : _decoration = decoration;
100 99
101 BoxDecoration _decoration; 100 BoxDecoration _decoration;
102 BoxDecoration get decoration => _decoration; 101 BoxDecoration get decoration => _decoration;
103 void set decoration (BoxDecoration value) { 102 void set decoration (BoxDecoration value) {
104 if (value == _decoration) 103 if (value == _decoration)
105 return; 104 return;
106 _decoration = value; 105 _decoration = value;
107 markNeedsPaint(); 106 markNeedsPaint();
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } 504 }
506 505
507 void layout(SectorConstraints constraints, { RenderNode relayoutSubtreeRoot }) { 506 void layout(SectorConstraints constraints, { RenderNode relayoutSubtreeRoot }) {
508 deltaRadius = constraints.constrainDeltaRadius(desiredDeltaRadius); 507 deltaRadius = constraints.constrainDeltaRadius(desiredDeltaRadius);
509 deltaTheta = constraints.constrainDeltaTheta(desiredDeltaTheta); 508 deltaTheta = constraints.constrainDeltaTheta(desiredDeltaTheta);
510 layoutDone(); 509 layoutDone();
511 } 510 }
512 511
513 void handlePointer(sky.PointerEvent event) { 512 void handlePointer(sky.PointerEvent event) {
514 if (event.type == 'pointerdown') 513 if (event.type == 'pointerdown')
515 setBoxDecoration(new BoxDecoration(backgroundColor: 0xFFFF0000)); 514 decoration = new BoxDecoration(backgroundColor: 0xFFFF0000);
516 else if (event.type == 'pointerup') 515 else if (event.type == 'pointerup')
517 setBoxDecoration(new BoxDecoration(backgroundColor: backgroundColor)); 516 decoration = new BoxDecoration(backgroundColor: backgroundColor);
518 } 517 }
519 } 518 }
520 519
521 AppView app; 520 AppView app;
522 521
523 void main() { 522 void main() {
524 523
525 var rootCircle = new RenderSectorRing(padding: 20.0); 524 var rootCircle = new RenderSectorRing(padding: 20.0);
526 rootCircle.add(new RenderSolidColor(0xFF00FFFF, desiredDeltaTheta: kTwoPi * 0. 15)); 525 rootCircle.add(new RenderSolidColor(0xFF00FFFF, desiredDeltaTheta: kTwoPi * 0. 15));
527 rootCircle.add(new RenderSolidColor(0xFF0000FF, desiredDeltaTheta: kTwoPi * 0. 4)); 526 rootCircle.add(new RenderSolidColor(0xFF0000FF, desiredDeltaTheta: kTwoPi * 0. 4));
528 var stack = new RenderSectorSlice(padding: 2.0); 527 var stack = new RenderSectorSlice(padding: 2.0);
529 stack.add(new RenderSolidColor(0xFFFFFF00, desiredDeltaRadius: 20.0)); 528 stack.add(new RenderSolidColor(0xFFFFFF00, desiredDeltaRadius: 20.0));
530 stack.add(new RenderSolidColor(0xFFFF9000, desiredDeltaRadius: 20.0)); 529 stack.add(new RenderSolidColor(0xFFFF9000, desiredDeltaRadius: 20.0));
531 stack.add(new RenderSolidColor(0xFF00FF00)); 530 stack.add(new RenderSolidColor(0xFF00FF00));
532 rootCircle.add(stack); 531 rootCircle.add(stack);
533 532
534 var root = new RenderBoxToRenderSectorAdapter(innerRadius: 50.0, child: rootCi rcle); 533 var root = new RenderBoxToRenderSectorAdapter(innerRadius: 50.0, child: rootCi rcle);
535 app = new AppView(root); 534 app = new AppView(root);
536 } 535 }
OLDNEW
« 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