Fix ui style scaling
This commit is contained in:
parent
12ad3c1c43
commit
ef9e820e90
1 changed files with 4 additions and 2 deletions
|
|
@ -21,13 +21,15 @@ namespace psemek::ui
|
|||
template <typename T>
|
||||
void scale(T & dst, float factor)
|
||||
{
|
||||
if (dst) dst = static_cast<T>((*dst) * factor);
|
||||
if (dst) dst = static_cast<T>(std::ceil((*dst) * factor));
|
||||
}
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
void scale(std::optional<geom::vector<T, N>> & dst, float factor)
|
||||
{
|
||||
if (dst) dst = geom::cast<T>(geom::cast<float>(*dst) * factor);
|
||||
if (dst)
|
||||
for (std::size_t i = 0; i < N; ++i)
|
||||
(*dst)[i] = static_cast<T>(std::ceil((*dst)[i] * factor));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue