various: moved more to core lib
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user