summaryrefslogtreecommitdiff
path: root/editor/import
diff options
context:
space:
mode:
authorGiwayume <giwayume@gmail.com>2021-11-22 14:34:23 -0500
committerGiwayume <giwayume@gmail.com>2021-11-23 10:56:36 -0500
commitcbca2cf152466c8cea0cd9748f8400cd907272ed (patch)
tree1e85eab807f35133fc8def4a66fc69d819fdb2c5 /editor/import
parentdbef4bbd98b655d6f89601c9e44c679b373b3628 (diff)
Fix edge case where 1px cut off from right of image
Remove -1 px
Diffstat (limited to 'editor/import')
-rw-r--r--editor/import/resource_importer_texture_atlas.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp
index 3fdf5dd9db..048d84d1f9 100644
--- a/editor/import/resource_importer_texture_atlas.cpp
+++ b/editor/import/resource_importer_texture_atlas.cpp
@@ -134,7 +134,7 @@ static void _plot_triangle(Vector2i *vertices, const Vector2i &p_offset, bool p_
int max_y = MIN(y[2], height - p_offset.y - 1);
for (int yi = y[0]; yi < max_y; yi++) {
if (yi >= 0) {
- for (int xi = (xf > 0 ? int(xf) : 0); xi < (xt < src_width ? xt : src_width - 1); xi++) {
+ for (int xi = (xf > 0 ? int(xf) : 0); xi < (xt <= src_width ? xt : src_width); xi++) {
int px = xi, py = yi;
int sx = px, sy = py;
sx = CLAMP(sx, 0, src_width - 1);