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

Unified Diff: sky/examples/raw/painting.sky

Issue 1158843002: Sky: Add a Point class. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: style revert 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/engine/core/painting/Point.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/raw/painting.sky
diff --git a/sky/examples/raw/painting.sky b/sky/examples/raw/painting.sky
index bd960e6efb871a2e94d6e33cf8bb7f38eaa5d7af..2b5597c923b76df21c9eba0daba9f35a9dd48603 100644
--- a/sky/examples/raw/painting.sky
+++ b/sky/examples/raw/painting.sky
@@ -14,13 +14,14 @@ void main() {
var element = document.getElementById('canvas');
element.requestPaint((PaintingContext context) {
Paint paint = new Paint();
- double radius = math.min(context.width, context.height) / 2.0;
+ Point mid = new Point(context.width / 2.0, context.height / 2.0);
+ double radius = math.min(mid.x, mid.y);
context.save();
context.clipRect(new Rect()..setLTRB(0.0, 0.0, context.width, radius));
- context.translate(context.width / 2.0, context.height / 2.0);
+ context.translate(mid.x, mid.y);
paint.setARGB(128, 255, 0, 255);
context.rotateDegrees(45.0);
« no previous file with comments | « sky/engine/core/painting/Point.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698