diff --git a/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp index 6ec97e4a..3ef4d6b7 100644 --- a/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp @@ -10,7 +10,6 @@ #include #include -#include "tilesheetpixelgrid.hpp" #include "tilesheetpixels.hpp" #include "tilesheeteditorview.hpp" diff --git a/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp index 80c67685..02a3d126 100644 --- a/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditormodel.cpp @@ -263,7 +263,13 @@ ox::Error TileSheetEditorModel::rotateRight() noexcept { } void TileSheetEditorModel::setSelection(studio::Selection const&sel) noexcept { - m_selection.emplace(sel); + auto const &ss = activeSubSheet(); + if (sel.a.x < ss.columns * TileWidth && sel.a.y < ss.rows * TileHeight) { + m_selection.emplace(sel); + } else { + m_selTracker.finishSelection(); + m_selection.reset(); + } m_updated = true; }