Correctly compute the center of the time picker (#6323)

Previously we assumed the dial was square, which isn't always the case.

Fixes #6315
This commit is contained in:
Adam Barth
2016-10-14 07:50:11 -07:00
committed by GitHub
parent 34584e99e0
commit 616ba9361f

View File

@@ -492,10 +492,9 @@ class _DialState extends State<_Dial> with SingleTickerProviderStateMixin {
void _handlePanStart(DragStartDetails details) {
assert(!_dragging);
_dragging = true;
RenderBox box = context.findRenderObject();
final RenderBox box = context.findRenderObject();
_position = box.globalToLocal(details.globalPosition);
double radius = box.size.shortestSide / 2.0;
_center = new Point(radius, radius);
_center = box.size.center(Point.origin);
_updateThetaForPan();
_notifyOnChangedIfNeeded();
}