made graph editor timeline-based rather than clip based, fixes #438

This commit is contained in:
itsmattkc
2019-02-07 00:44:47 -08:00
parent 8a5c25f41d
commit d804f7cfc0
5 changed files with 34 additions and 15 deletions
+7
View File
@@ -1,9 +1,11 @@
#include "keyframedrawing.h"
#include "project/effect.h"
#include "project/clip.h"
#define KEYFRAME_POINT_COUNT 4
// routine for drawing a keyframe onscreen
void draw_keyframe(QPainter &p, int type, int x, int y, bool darker, int r, int g, int b) {
if (darker) {
r *= 0.625;
@@ -30,3 +32,8 @@ void draw_keyframe(QPainter &p, int type, int x, int y, bool darker, int r, int
p.setBrush(Qt::NoBrush);
}
// adjusts keyframe's internal time (in clip time) to timeline time
long adjust_row_keyframe(EffectRow* row, long time, long visible_in) {
return time-row->parent_effect->parent_clip->clip_in+(row->parent_effect->parent_clip->timeline_in-visible_in);
}