Skip to content

Commit bf813b6

Browse files
fix: Restrict pointer to progress bar bounds
1 parent 9395d54 commit bf813b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/progress_bar.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ extension RelativePositionExtensions on BuildContext {
266266
if (globalPosition == null) return null;
267267
final box = findRenderObject()! as RenderBox;
268268
final Offset tapPos = box.globalToLocal(globalPosition);
269-
final double relative = tapPos.dx / box.size.width;
269+
final double relative = (tapPos.dx / box.size.width).clamp(0, 1);
270270
final Duration position = videoDuration * relative;
271271
return position;
272272
}

0 commit comments

Comments
 (0)