Code/Editor

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-16 15:56:36 -07:00
parent e6b5342c07
commit 2963739288
51 changed files with 286 additions and 337 deletions
+7 -7
View File
@@ -25,9 +25,9 @@ static const QColor ltgrayCol = QColor(110, 110, 110);
QColor InterpolateColor(const QColor& c1, const QColor& c2, float fraction)
{
const int r = (c2.red() - c1.red()) * fraction + c1.red();
const int g = (c2.green() - c1.green()) * fraction + c1.green();
const int b = (c2.blue() - c1.blue()) * fraction + c1.blue();
const int r = static_cast<int>(static_cast<float>(c2.red() - c1.red()) * fraction + c1.red());
const int g = static_cast<int>(static_cast<float>(c2.green() - c1.green()) * fraction + c1.green());
const int b = static_cast<int>(static_cast<float>(c2.blue() - c1.blue()) * fraction + c1.blue());
return QColor(r, g, b);
}
@@ -120,7 +120,7 @@ float TimelineWidget::SnapTime(float time)
{
double t = floor((double)time * m_ticksStep + 0.5);
t = t / m_ticksStep;
return t;
return static_cast<float>(t);
}
//////////////////////////////////////////////////////////////////////////
@@ -153,10 +153,10 @@ void TimelineWidget::DrawTicks(QPainter* painter)
painter->setPen(redpen);
int x = TimeToClient(m_fTimeMarker);
painter->setBrush(Qt::NoBrush);
painter->drawRect(QRect(QPoint(x - 3, rc.top()), QPoint(x + 2, rc.bottom())));
painter->drawRect(QRect(QPoint(x - 3, static_cast<int>(rc.top())), QPoint(x + 2, static_cast<int>(rc.bottom()))));
painter->setPen(redpen);
painter->drawLine(x, rc.top(), x, rc.bottom());
painter->drawLine(x, static_cast<int>(rc.top()), x, static_cast<int>(rc.bottom()));
painter->setBrush(Qt::NoBrush);
// Draw vertical line showing current time.
@@ -190,7 +190,7 @@ void TimelineWidget::DrawTicks(QPainter* painter)
float keyTime = (m_pKeyTimeSet ? m_pKeyTimeSet->GetKeyTime(keyTimeIndex) : 0.0f);
int x2 = TimeToClient(keyTime);
painter->drawRect(QRect(QPoint(x2 - 1, rc.top()), QPoint(x2 + 2, rc.bottom())));
painter->drawRect(QRect(QPoint(x2 - 1, static_cast<int>(rc.top())), QPoint(x2 + 2, static_cast<int>(rc.bottom()))));
}
painter->setPen(pOldPen);