correct frame offsets in graph view

This commit is contained in:
itsmattkc
2019-01-04 18:36:47 +11:00
parent 28fbab2d78
commit f444cdb8bb
3 changed files with 9 additions and 2 deletions
+1
View File
@@ -185,6 +185,7 @@ void GraphEditor::set_row(EffectRow *r) {
if (found_vals) {
row = r;
current_row_desc->setText(row->parent_effect->parent_clip->name + " :: " + row->parent_effect->meta->name + " :: " + row->get_name());
header->set_visible_in(r->parent_effect->parent_clip->timeline_in);
connect(keyframe_nav, SIGNAL(goto_previous_key()), row, SLOT(goto_previous_key()));
connect(keyframe_nav, SIGNAL(toggle_key()), row, SLOT(toggle_key()));
+6 -2
View File
@@ -14,6 +14,7 @@
#include "ui/keyframedrawing.h"
#include "project/undo.h"
#include "project/effect.h"
#include "project/clip.h"
#include "ui/rectangleselect.h"
#include "debug.h"
@@ -43,7 +44,8 @@ GraphView::GraphView(QWidget* parent) :
row(NULL),
moved_keys(false),
current_handle(BEZIER_HANDLE_NONE),
rect_select(false)
rect_select(false),
visible_in(0)
{
setMouseTracking(true);
setFocusPolicy(Qt::ClickFocus);
@@ -228,7 +230,7 @@ void GraphView::paintEvent(QPaintEvent *event) {
// draw playhead
p.setPen(Qt::red);
int playhead_x = get_screen_x(panel_sequence_viewer->seq->playhead);
int playhead_x = get_screen_x(panel_sequence_viewer->seq->playhead - visible_in);
p.drawLine(playhead_x, 0, playhead_x, height());
if (rect_select) {
@@ -339,6 +341,7 @@ void GraphView::mousePressEvent(QMouseEvent *event) {
}
void GraphView::mouseMoveEvent(QMouseEvent *event) {
unsetCursor();
if (mousedown) {
if (event->buttons() & Qt::MiddleButton || panel_timeline->tool == TIMELINE_TOOL_HAND) {
set_scroll_x(x_scroll + start_x - event->pos().x());
@@ -494,6 +497,7 @@ void GraphView::set_row(EffectRow *r) {
if (row != NULL) {
field_visibility.resize(row->fieldCount());
field_visibility.fill(true);
visible_in = row->parent_effect->parent_clip->timeline_in;
}
update();
}
+2
View File
@@ -70,6 +70,8 @@ private:
int rect_select_w;
int rect_select_h;
int rect_select_offset;
long visible_in;
private slots:
void show_context_menu(const QPoint& pos);
void reset_view();