Skip to content

Commit

Permalink
fix: Restrict pointer to progress bar bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
koutaro-masaki committed Nov 27, 2023
1 parent 9395d54 commit bf813b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ extension RelativePositionExtensions on BuildContext {
if (globalPosition == null) return null;
final box = findRenderObject()! as RenderBox;
final Offset tapPos = box.globalToLocal(globalPosition);
final double relative = tapPos.dx / box.size.width;
final double relative = (tapPos.dx / box.size.width).clamp(0, 1);
final Duration position = videoDuration * relative;
return position;
}
Expand Down

0 comments on commit bf813b6

Please sign in to comment.