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

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

Issue 1177563002: SkyView should handle screen rotation (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fixed 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 | « sky/sdk/lib/framework/app.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/rendering/box.dart
diff --git a/sky/sdk/lib/framework/rendering/box.dart b/sky/sdk/lib/framework/rendering/box.dart
index 520625626635d6ad86ce6195cdedd370a5a71dee..baa68a727cf79b03ddd38406aa2e5b9c63527274 100644
--- a/sky/sdk/lib/framework/rendering/box.dart
+++ b/sky/sdk/lib/framework/rendering/box.dart
@@ -947,19 +947,27 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
int get orientation => _orientation;
Duration timeForRotation;
+ ViewConstraints _rootConstraints;
+ ViewConstraints get rootConstraints => _rootConstraints;
+ void set rootConstraints(ViewConstraints value) {
+ if (_rootConstraints == value)
+ return;
+ _rootConstraints = value;
+ markNeedsLayout();
+ }
+
ViewConstraints get constraints => super.constraints as ViewConstraints;
- bool get sizedByParent => true;
- void performResize() {
- if (constraints.orientation != _orientation) {
+
+ void performLayout() {
+ if (_rootConstraints.orientation != _orientation) {
if (_orientation != null && child != null)
- child.rotate(oldAngle: _orientation, newAngle: constraints.orientation, time: timeForRotation);
- _orientation = constraints.orientation;
+ child.rotate(oldAngle: _orientation, newAngle: _rootConstraints.orientation, time: timeForRotation);
+ _orientation = _rootConstraints.orientation;
}
- _size = new Size(constraints.width, constraints.height);
+ _size = new Size(_rootConstraints.width, _rootConstraints.height);
assert(_size.height < double.INFINITY);
assert(_size.width < double.INFINITY);
- }
- void performLayout() {
+
if (child != null) {
child.layout(new BoxConstraints.tight(_size));
assert(child.size.width == width);
« no previous file with comments | « sky/sdk/lib/framework/app.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698