Respect map dimension changes in undo/redo history

This commit is contained in:
Marcus Huderle
2018-07-09 17:40:34 -05:00
parent 37903a5acb
commit aafe258842
6 changed files with 81 additions and 43 deletions

View File

@@ -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;