mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-13 20:36:19 -05:00
Respect map dimension changes in undo/redo history
This commit is contained in:
20
editor.cpp
20
editor.cpp
@@ -26,13 +26,15 @@ void Editor::save() {
|
||||
|
||||
void Editor::undo() {
|
||||
if (current_view) {
|
||||
((MapPixmapItem*)current_view)->undo();
|
||||
map->undo();
|
||||
map_item->draw();
|
||||
}
|
||||
}
|
||||
|
||||
void Editor::redo() {
|
||||
if (current_view) {
|
||||
((MapPixmapItem*)current_view)->redo();
|
||||
map->redo();
|
||||
map_item->draw();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1216,20 +1218,6 @@ void MapPixmapItem::draw(bool ignoreCache) {
|
||||
}
|
||||
}
|
||||
|
||||
void MapPixmapItem::undo() {
|
||||
if (map) {
|
||||
map->undo();
|
||||
draw();
|
||||
}
|
||||
}
|
||||
|
||||
void MapPixmapItem::redo() {
|
||||
if (map) {
|
||||
map->redo();
|
||||
draw();
|
||||
}
|
||||
}
|
||||
|
||||
void MapPixmapItem::updateCurHoveredTile(QPointF pos) {
|
||||
int x = ((int)pos.x()) / 16;
|
||||
int y = ((int)pos.y()) / 16;
|
||||
|
||||
Reference in New Issue
Block a user