diff --git a/src/blah_packer.cpp b/src/blah_packer.cpp index 029f3bc..a5fc93d 100644 --- a/src/blah_packer.cpp +++ b/src/blah_packer.cpp @@ -40,7 +40,7 @@ void Packer::add_entry(u64 id, int w, int h, const Color* pixels, const Recti& s // TOP: for (int y = source.y; y < source.y + source.h; y++) - for (int x = source.x, s = y * w; x < source.x + source.w; x++, s++) + for (int x = source.x, s = x + y * w; x < source.x + source.w; x++, s++) if (pixels[s].a > 0) { top = y; @@ -304,4 +304,4 @@ Packer::Node* Packer::Node::reset(const Recti& rect) right = nullptr; down = nullptr; return this; -} \ No newline at end of file +}