Skip to content

Commit

Permalink
Merge pull request #4573 from eseidelGoogle/switch
Browse files Browse the repository at this point in the history
Fix the switch to match the Material Design spec.
  • Loading branch information
eseidelGoogle committed Jun 15, 2016
2 parents 0d21e69 + 3ee2f6f commit 7fcaf09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/flutter/lib/src/material/switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class _SwitchRenderObjectWidget extends LeafRenderObjectWidget {
}

const double _kTrackHeight = 14.0;
const double _kTrackWidth = 29.0;
const double _kTrackWidth = 33.0;
const double _kTrackRadius = _kTrackHeight / 2.0;
const double _kThumbRadius = 10.0;
const double _kSwitchWidth = _kTrackWidth - 2 * _kTrackRadius + 2 * kRadialReactionRadius;
Expand Down Expand Up @@ -355,7 +355,7 @@ class _RenderSwitch extends RenderToggleable {
}

// The thumb contracts slightly during the animation
double inset = 2.0 - (currentPosition - 0.5).abs() * 2.0;
double inset = 1.0 - (currentPosition - 0.5).abs() * 2.0;
double radius = _kThumbRadius - inset;
Rect thumbRect = new Rect.fromLTRB(thumbPosition.x + offset.dx - radius,
thumbPosition.y + offset.dy - radius,
Expand Down

0 comments on commit 7fcaf09

Please sign in to comment.