| OLD | NEW |
| 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:sky' as sky; | 5 import 'dart:sky' as sky; |
| 6 | 6 |
| 7 import 'package:sky/app/scheduler.dart'; | 7 import 'package:sky/app/scheduler.dart'; |
| 8 import 'package:sky/rendering/box.dart'; | 8 import 'package:sky/rendering/box.dart'; |
| 9 import 'package:sky/rendering/flex.dart'; | 9 import 'package:sky/rendering/flex.dart'; |
| 10 import 'package:sky/widgets/basic.dart'; | 10 import 'package:sky/widgets/basic.dart'; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 transformBox.setIdentity(); | 70 transformBox.setIdentity(); |
| 71 transformBox.translate(transformBox.size.width / 2.0, transformBox.size.height
/ 2.0); | 71 transformBox.translate(transformBox.size.width / 2.0, transformBox.size.height
/ 2.0); |
| 72 transformBox.rotateZ(delta); | 72 transformBox.rotateZ(delta); |
| 73 transformBox.translate(-transformBox.size.width / 2.0, -transformBox.size.heig
ht / 2.0); | 73 transformBox.translate(-transformBox.size.width / 2.0, -transformBox.size.heig
ht / 2.0); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void main() { | 76 void main() { |
| 77 // Because we're going to use UINodes, we want to initialise its | 77 // Because we're going to use UINodes, we want to initialise its |
| 78 // AppView, not use the default one. We don't really need to do | 78 // AppView, not use the default one. We don't really need to do |
| 79 // this, because RenderObjectToUINodeAdapter does it for us, but | 79 // this, because RenderBoxToUINodeAdapter does it for us, but |
| 80 // it's good practice in case we happen to not have a | 80 // it's good practice in case we happen to not have a |
| 81 // RenderObjectToUINodeAdapter in our tree at startup, or in case we | 81 // RenderBoxToUINodeAdapter in our tree at startup, or in case we |
| 82 // want a renderViewOverride. | 82 // want a renderViewOverride. |
| 83 UINodeAppView.initUINodeAppView(); | 83 UINodeAppView.initUINodeAppView(); |
| 84 | 84 |
| 85 RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical); | 85 RenderFlex flexRoot = new RenderFlex(direction: FlexDirection.vertical); |
| 86 | 86 |
| 87 RenderProxyBox proxy = new RenderProxyBox(); | 87 RenderProxyBox proxy = new RenderProxyBox(); |
| 88 new RenderObjectToUINodeAdapter(proxy, builder); // adds itself to proxy | 88 new RenderBoxToUINodeAdapter(proxy, builder); // adds itself to proxy |
| 89 | 89 |
| 90 addFlexChildSolidColor(flexRoot, const sky.Color(0xFFFF00FF), flex: 1); | 90 addFlexChildSolidColor(flexRoot, const sky.Color(0xFFFF00FF), flex: 1); |
| 91 flexRoot.add(proxy); | 91 flexRoot.add(proxy); |
| 92 addFlexChildSolidColor(flexRoot, const sky.Color(0xFF0000FF), flex: 1); | 92 addFlexChildSolidColor(flexRoot, const sky.Color(0xFF0000FF), flex: 1); |
| 93 | 93 |
| 94 transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.ide
ntity()); | 94 transformBox = new RenderTransform(child: flexRoot, transform: new Matrix4.ide
ntity()); |
| 95 RenderPadding root = new RenderPadding(padding: new EdgeDims.all(20.0), child:
transformBox); | 95 RenderPadding root = new RenderPadding(padding: new EdgeDims.all(20.0), child:
transformBox); |
| 96 | 96 |
| 97 UINodeAppView.appView.root = root; | 97 UINodeAppView.appView.root = root; |
| 98 addPersistentFrameCallback(rotate); | 98 addPersistentFrameCallback(rotate); |
| 99 } | 99 } |
| OLD | NEW |