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); |