Gems/LyShine

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-16 15:57:19 -07:00
parent 939c188448
commit 2ab9648425
9 changed files with 194 additions and 195 deletions
@@ -20,9 +20,9 @@
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);
}
@@ -114,7 +114,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);
}
//////////////////////////////////////////////////////////////////////////
@@ -147,10 +147,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 + 4, rc.bottom())));
painter->drawRect(QRect(QPoint(x - 3, static_cast<int>(rc.top())), QPoint(x + 4, 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.
@@ -184,7 +184,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 - 2, rc.top()), QPoint(x2 + 3, rc.bottom())));
painter->drawRect(QRect(QPoint(x2 - 2, static_cast<int>(rc.top())), QPoint(x2 + 3, static_cast<int>(rc.bottom()))));
}
painter->setPen(pOldPen);