feat: canvas from texture atlas element
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user