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:math' as math; | 5 import 'dart:math' as math; |
6 import 'dart:sky' as sky; | 6 import 'dart:sky' as sky; |
7 | 7 |
8 import 'package:sky/rendering/box.dart'; | 8 import 'package:sky/rendering/box.dart'; |
9 import 'package:sky/rendering/object.dart'; | 9 import 'package:sky/rendering/object.dart'; |
10 import 'package:sky/theme/colors.dart' as colors; | 10 import 'package:sky/theme/colors.dart' as colors; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 Path path = new Path(); | 54 Path path = new Path(); |
55 path.moveTo(centerX, arrowY - h); // top of the arrow | 55 path.moveTo(centerX, arrowY - h); // top of the arrow |
56 path.lineTo(centerX + w, arrowY + h); | 56 path.lineTo(centerX + w, arrowY + h); |
57 path.lineTo(centerX - w, arrowY + h); | 57 path.lineTo(centerX - w, arrowY + h); |
58 path.close(); | 58 path.close(); |
59 paint.setStyle(sky.PaintingStyle.fill); | 59 paint.setStyle(sky.PaintingStyle.fill); |
60 canvas.drawPath(path, paint); | 60 canvas.drawPath(path, paint); |
61 | 61 |
62 // Draw a circle that circumscribes the arrow. | 62 // Draw a circle that circumscribes the arrow. |
63 paint.setStyle(sky.PaintingStyle.stroke); | 63 paint.setStyle(sky.PaintingStyle.stroke); |
64 canvas.drawCircle(centerX, centerY, r, paint); | 64 canvas.drawCircle(new Point(centerX, centerY), r, paint); |
65 }); | 65 }); |
66 | 66 |
67 return new Container( | 67 return new Container( |
68 child: arrow, | 68 child: arrow, |
69 width: kSize, | 69 width: kSize, |
70 height: kSize, | 70 height: kSize, |
71 margin: const EdgeDims.symmetric(horizontal: 5.0) | 71 margin: const EdgeDims.symmetric(horizontal: 5.0) |
72 ); | 72 ); |
73 } | 73 } |
74 | 74 |
75 } | 75 } |
OLD | NEW |