various: moved more to core lib

This commit is contained in:
itsmattkc
2023-01-19 16:01:31 -08:00
parent dd9c52ab59
commit c1c6893713
92 changed files with 448 additions and 1558 deletions
+4 -6
View File
@@ -22,8 +22,6 @@
#include <QDebug>
#include "common/clamp.h"
namespace olive {
int QtUtils::QFontMetricsWidth(QFontMetrics fm, const QString& s) {
@@ -179,10 +177,10 @@ QColor QtUtils::toQColor(const core::Color &i)
QColor c;
// QColor only supports values from 0.0 to 1.0 and are only used for UI representations
c.setRedF(clamp(i.red(), 0.0f, 1.0f));
c.setGreenF(clamp(i.green(), 0.0f, 1.0f));
c.setBlueF(clamp(i.blue(), 0.0f, 1.0f));
c.setAlphaF(clamp(i.alpha(), 0.0f, 1.0f));
c.setRedF(std::clamp(i.red(), 0.0f, 1.0f));
c.setGreenF(std::clamp(i.green(), 0.0f, 1.0f));
c.setBlueF(std::clamp(i.blue(), 0.0f, 1.0f));
c.setAlphaF(std::clamp(i.alpha(), 0.0f, 1.0f));
return c;
}