all time-based panels are now derived from a common base class

Cuts down on a lot of duplicate code between
TimelineWidget/ViewerWidget/CurveWidget/NodeParamView
and TimelinePanel/ViewerPanel/CurvePanel/ParamPanel since they all use similar
time functions.
This commit is contained in:
itsmattkc
2020-02-01 19:39:43 +11:00
parent 5d58479f0a
commit 17c1493aa7
62 changed files with 1076 additions and 1042 deletions
+3 -3
View File
@@ -157,16 +157,16 @@ bool TimelineWidget::Tool::SnapPoint(QList<rational> start_times, rational* move
QList<double> proposed_pts;
foreach (rational s, start_times) {
proposed_pts.append((s + *movement).toDouble() * parent()->scale_);
proposed_pts.append((s + *movement).toDouble() * parent()->GetScale());
}
if (snap_points & kSnapToPlayhead) {
rational playhead_abs_time = rational(parent()->playhead_ * parent()->timebase().numerator(),
rational playhead_abs_time = rational(parent()->GetTimestamp() * parent()->timebase().numerator(),
parent()->timebase().denominator());
qreal playhead_pos = playhead_abs_time.toDouble() * parent()->scale_;
qreal playhead_pos = playhead_abs_time.toDouble() * parent()->GetScale();
AttemptSnap(proposed_pts, playhead_pos, start_times, playhead_abs_time, movement, &diff);
}