added autoscrolling to keyframe view seek

This commit is contained in:
itsmattkc
2019-01-08 22:47:02 +11:00
parent 510c198b1a
commit d3b02f3f53
6 changed files with 107 additions and 92 deletions
+1 -10
View File
@@ -476,16 +476,7 @@ void Timeline::select_all() {
}
void Timeline::scroll_to_frame(long frame) {
if (sequence != NULL) {
int screen_point = getTimelineScreenPointFromFrame(frame);
int min_x = timeline_area->width()*0.1;
int max_x = timeline_area->width()*0.9;
if (screen_point < min_x) {
horizontalScrollBar->setValue(getScreenPointFromFrame(zoom, frame) - min_x);
} else if (screen_point > max_x) {
horizontalScrollBar->setValue(getScreenPointFromFrame(zoom, frame) - max_x);
}
}
scroll_to_frame_internal(horizontalScrollBar, frame, zoom, timeline_area->width());
}
void Timeline::resizeEvent(QResizeEvent *event) {