Set default tilemap and tileset modes

When layers of different kinds (tilemap and image) are selected set the
default modes when the last selected layer is image type.
This commit is contained in:
Martín Capello 2024-08-12 11:27:41 -03:00 committed by David Capello
parent e7f308bbfe
commit d88c22386d

View File

@ -58,6 +58,12 @@ MovingSliceState::MovingSliceState(Editor* editor,
}
editor->getSite(&m_site);
// Prevent using different tilemap and tileset modes when the last selected
// layer is not a tilemap.
if (!m_site.layer()->isTilemap()) {
m_site.tilemapMode(TilemapMode::Pixels);
m_site.tilesetMode(TilesetMode::Auto);
}
if (editor->slicesTransforms() && !m_items.empty()) {
DocRange range = m_site.range();