Commit 616ba936 authored by Adam Barth's avatar Adam Barth Committed by GitHub

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

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

Fixes #6315
parent 34584e99
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment