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

Unified Diff: sky/engine/core/painting/Rect.dart

Issue 1233623007: Provide some debug-mode time hooks to visually debug painting and layout. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | sky/sdk/lib/base/debug.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/Rect.dart
diff --git a/sky/engine/core/painting/Rect.dart b/sky/engine/core/painting/Rect.dart
index 85fe07331e05b24ac4583377b91de6b21ba90b5b..8a82e69a5666da44193f868ccba392882c6e41de 100644
--- a/sky/engine/core/painting/Rect.dart
+++ b/sky/engine/core/painting/Rect.dart
@@ -30,6 +30,13 @@ class Rect {
double get right => _value[2];
double get bottom => _value[3];
+ Rect shift(Offset offset) {
+ return new Rect.fromLTRB(left + offset.dx, top + offset.dy, right + offset.dx, bottom + offset.dy);
+ }
+ Rect inflate(double delta) {
+ return new Rect.fromLTRB(left - delta, top - delta, right + delta, bottom + delta);
+ }
+
double get width => right - left;
double get height => bottom - top;
« no previous file with comments | « no previous file | sky/sdk/lib/base/debug.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698