adjustThumbCenter method

Offset adjustThumbCenter(
  1. Offset thumbCenter,
  2. Rect trackRect
)

Implementation

Offset adjustThumbCenter(Offset thumbCenter, Rect trackRect) {
  final value = (thumbCenter.dx - trackRect.left) / trackRect.width;
  final x = value * (trackRect.width - 24) + trackRect.left + 12;
  return Offset(x, thumbCenter.dy);
}