[nostalgia/gfx/studio/tilesheet] Fix selection clearing to work when clicking outside image
All checks were successful
Build / build (push) Successful in 1m19s
All checks were successful
Build / build (push) Successful in 1m19s
This commit is contained in:
parent
2751872c59
commit
55ed75f44d
@ -10,7 +10,6 @@
|
||||
#include <studio/editor.hpp>
|
||||
#include <studio/filepickerpopup.hpp>
|
||||
|
||||
#include "tilesheetpixelgrid.hpp"
|
||||
#include "tilesheetpixels.hpp"
|
||||
#include "tilesheeteditorview.hpp"
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user