Skip to content

Commit fc47911

Browse files
committed
Prevent slider going out of timeline bounds
1 parent c800c1c commit fc47911

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Source/Processors/FileReader/FileReaderEditor.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,14 @@ void ZoomTimeline::mouseDrag(const MouseEvent & event)
324324

325325
lastDragXPosition = event.x;
326326

327+
328+
// Prevent slider going out of timeline bounds
329+
if (leftSliderPosition < 0)
330+
leftSliderPosition = 0;
331+
332+
if (rightSliderPosition > getWidth() - sliderWidth)
333+
rightSliderPosition = getWidth() - sliderWidth;
334+
327335
repaint();
328336

329337
}
@@ -333,6 +341,7 @@ void ZoomTimeline::mouseUp(const MouseEvent& event)
333341

334342
leftSliderIsSelected = false;
335343
rightSliderIsSelected = false;
344+
playbackRegionIsSelected = false;
336345

337346
static_cast<FileReaderEditor*>(fileReader->getEditor())->updatePlaybackTimes();
338347

0 commit comments

Comments
 (0)