reVeno/Source/Veno/Utils.cpp

27 lines
464 B
C++
Raw Normal View History

2020-06-13 10:56:20 +02:00
//
// Created by versustune on 08.06.20.
//
#include "Utils.h"
#include "Core/Config.h"
int VeNo::Utils::nextPowerOfTwo (float value)
{
2020-06-13 10:56:20 +02:00
unsigned int v = value;
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
v++;
return v;
}
float VeNo::Utils::setFontSize (float size, Graphics& g)
{
double scale = Config::getInstance ()->getScale ();
2020-06-13 10:56:20 +02:00
float s = size * scale;
g.setFont (s);
2020-06-13 10:56:20 +02:00
return s;
}