From d0a55803214a8987c6ce3ba631a2962928affad9 Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Mon, 20 Dec 2021 21:37:22 +0100 Subject: [PATCH] EditorAtlasPacker Fix incorrectly deducing zero height in some cases (cherry picked from commit 46eebf11ca57f81590f305a5ba28e445f33a1f4e) --- editor/editor_atlas_packer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/editor_atlas_packer.cpp b/editor/editor_atlas_packer.cpp index 300d7ed2b1f..8ba5dc60886 100644 --- a/editor/editor_atlas_packer.cpp +++ b/editor/editor_atlas_packer.cpp @@ -232,12 +232,12 @@ void EditorAtlasPacker::chart_pack(Vector &charts, int &r_width, int &r_h const int *top_heights = bitmaps[i].top_heights.ptr(); const int *bottom_heights = bitmaps[i].bottom_heights.ptr(); - for (int j = 0; j < atlas_w - w; j++) { + for (int j = 0; j <= atlas_w - w; j++) { int height = 0; for (int k = 0; k < w; k++) { int pixmap_h = bottom_heights[k]; - if (pixmap_h == -1) { + if (pixmap_h == 0x7FFFFFFF) { continue; //no pixel here, anything is fine }