From 6f6102f22c8265f05940c8b8a2b9e5aa31304663 Mon Sep 17 00:00:00 2001 From: dankan1890 Date: Wed, 16 Sep 2020 01:26:56 +0200 Subject: [PATCH] Fixed TextureAtlas import wrong images size. Fix #42057 (cherry picked from commit 395ab3441d68c23d12fd9a2de6740c386b3072aa) --- editor/import/resource_importer_texture_atlas.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/import/resource_importer_texture_atlas.cpp b/editor/import/resource_importer_texture_atlas.cpp index 4837c2b8a07..b5d13804654 100644 --- a/editor/import/resource_importer_texture_atlas.cpp +++ b/editor/import/resource_importer_texture_atlas.cpp @@ -128,9 +128,9 @@ static void _plot_triangle(Vector2 *vertices, const Vector2 &p_offset, bool p_tr double xf = x[0]; double xt = x[0] + dx_upper; // if y[0] == y[1], special case int max_y = MIN(y[2], height - p_offset.y - 1); - for (int yi = y[0]; yi <= max_y; yi++) { + for (int yi = y[0]; yi < max_y; yi++) { if (yi >= 0) { - for (int xi = (xf > 0 ? int(xf) : 0); xi <= (xt < width ? xt : width - 1); xi++) { + for (int xi = (xf > 0 ? int(xf) : 0); xi < (xt < width ? xt : width - 1); xi++) { int px = xi, py = yi; int sx = px, sy = py; sx = CLAMP(sx, 0, src_width - 1);