use raw time values independent of timebase for scaling timeline ui

This commit is contained in:
itsmattkc
2019-08-09 16:41:17 +10:00
parent 0a56dbe429
commit 09d73ebc2b
14 changed files with 123 additions and 60 deletions
+2 -14
View File
@@ -7,26 +7,14 @@ TimelineViewRect::TimelineViewRect(QGraphicsItem* parent) :
}
void TimelineViewRect::SetTimebase(const rational &timebase)
{
timebase_ = timebase;
timebase_dbl_ = timebase_.toDouble();
UpdateRect();
}
void TimelineViewRect::SetScale(const double &scale)
{
scale_ = scale;
UpdateRect();
}
bool TimelineViewRect::TimebaseIsValid()
{
return timebase_.denominator() != 0;
UpdateRect();
}
double TimelineViewRect::TimeToScreenCoord(const rational &time)
{
return time.toDouble() / timebase_dbl_ * scale_;
return time.toDouble() * scale_;
}