summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-24 08:01:47 +0100
committerGitHub <noreply@github.com>2021-11-24 08:01:47 +0100
commitefd0db85f6fef4414aa6eb839a72ca75c2feb54b (patch)
treeff8901e60f5129847f2030f24b3b796bb4184b52 /editor
parent96e70ac5f4f477eee3866ea788389a87d0dbd086 (diff)
parentcbca2cf152466c8cea0cd9748f8400cd907272ed (diff)
Merge pull request #55238 from Giwayume/bugfix/atlas_cutoff_edge_master
Atlas import 1px missing from right side of non-cropped image.
Diffstat (limited to 'editor')
-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);