Skip to content

Commit

Permalink
don't refuse to replace a tile with a selection if the top left of th…
Browse files Browse the repository at this point in the history
…e selection is the same as the replaced tile
  • Loading branch information
Narre committed Jul 15, 2023
1 parent fa8f068 commit 8e9e205
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/editor/overlay_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ EditorOverlayWidget::replace()
auto tilemap = m_editor.get_selected_tilemap();
Uint32 replace_tile = tilemap->get_tile_id(static_cast<int>(m_hovered_tile.x), static_cast<int>(m_hovered_tile.y));
//don't do anything if the old and new tiles are the same tile
if (replace_tile == m_editor.get_tiles()->pos(0, 0)) return;
if (m_editor.get_tiles()->m_width == 1 && m_editor.get_tiles()->m_height == 1 && replace_tile == m_editor.get_tiles()->pos(0, 0)) return;

tilemap->save_state();
for (int x = 0; x < tilemap->get_width(); ++x)
Expand Down

0 comments on commit 8e9e205

Please sign in to comment.