added autoscrolling when seeking the timeline
This commit is contained in:
@@ -475,6 +475,19 @@ 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Timeline::resizeEvent(QResizeEvent *event) {
|
void Timeline::resizeEvent(QResizeEvent *event) {
|
||||||
if (sequence != NULL) set_sb_max();
|
if (sequence != NULL) set_sb_max();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ public:
|
|||||||
QPushButton* toolTransitionButton;
|
QPushButton* toolTransitionButton;
|
||||||
QPushButton* snappingButton;
|
QPushButton* snappingButton;
|
||||||
|
|
||||||
|
void scroll_to_frame(long frame);
|
||||||
|
|
||||||
void resizeEvent(QResizeEvent *event);
|
void resizeEvent(QResizeEvent *event);
|
||||||
public slots:
|
public slots:
|
||||||
void repaint_timeline();
|
void repaint_timeline();
|
||||||
|
|||||||
@@ -237,6 +237,7 @@ bool frame_rate_is_droppable(float rate) {
|
|||||||
void Viewer::seek(long p) {
|
void Viewer::seek(long p) {
|
||||||
pause();
|
pause();
|
||||||
seq->playhead = p;
|
seq->playhead = p;
|
||||||
|
if (main_sequence) panel_timeline->scroll_to_frame(p);
|
||||||
update_parents();
|
update_parents();
|
||||||
reset_all_audio();
|
reset_all_audio();
|
||||||
audio_scrub = true;
|
audio_scrub = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user