From 804d78e116ca07a13f0a3bd053875657fb6dfbcd Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 1 Feb 2025 15:14:24 -0600 Subject: [PATCH] [nostalgia/gfx/studio] Cleanup --- .../gfx/src/studio/tilesheeteditor/commands/drawcommand.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/drawcommand.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/drawcommand.cpp index 8f6c46ef..b84b0f6a 100644 --- a/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/drawcommand.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/commands/drawcommand.cpp @@ -3,7 +3,6 @@ */ #include -#include #include "drawcommand.hpp" @@ -120,7 +119,8 @@ void DrawCommand::lineUpdate(ox::Point a, ox::Point b) noexcept { if (a.x > b.x) { --b.x; } iterateLine(a, b, [this, &ss](int32_t const x, int32_t const y, int32_t const h) { int const mod = h < 0 ? -1 : 1; - for (int32_t i{}; i < abs(h); ++i) { + auto const range = h * mod; + for (int32_t i{}; i < range; ++i) { auto const idx = ptToIdx(x, y + i * mod, ss.columns * TileWidth); if (idx < ss.pixels.size()) { m_changes.emplace_back(static_cast(idx), getPixel(ss, idx));