feat: canvas from texture atlas element

This commit is contained in:
MihailRis
2025-11-05 00:20:58 +03:00
parent 497160a5b9
commit d9f2d54bf0
10 changed files with 126 additions and 28 deletions
+7 -2
View File
@@ -1,8 +1,7 @@
#pragma once
#include <cmath>
#include <glm/vec2.hpp>
#include <glm/vec4.hpp>
#include <glm/glm.hpp>
struct UVRegion {
float u1;
@@ -69,4 +68,10 @@ struct UVRegion {
copy.scale(scale);
return copy;
}
bool isFull() const {
const auto e = 1e-7;
return glm::abs(u1 - 0.0) < e && glm::abs(v1 - 0.0) < e &&
glm::abs(u2 - 1.0) < e && glm::abs(v2 - 1.0) < e;
}
};