diff --git a/src/core/map.cpp b/src/core/map.cpp index 8b2e56cf..8cf47675 100644 --- a/src/core/map.cpp +++ b/src/core/map.cpp @@ -310,6 +310,12 @@ void Map::setDimensions(int newWidth, int newHeight, bool setNewBlockdata) { setNewDimensionsBlockdata(newWidth, newHeight); } + int oldWidth = layout->width.toInt(); + int oldHeight = layout->height.toInt(); + if (oldWidth != newWidth || oldHeight != newHeight) { + Scripting::cb_MapResized(oldWidth, oldHeight, newWidth, newHeight); + } + layout->width = QString::number(newWidth); layout->height = QString::number(newHeight); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4b66a4da..d46e30f5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2969,10 +2969,6 @@ void MainWindow::on_pushButton_ChangeDimensions_clicked() oldBorder, map->layout->border )); } - if (oldMapDimensions != newMapDimensions) { - Scripting::cb_MapResized(oldMapDimensions.width(), oldMapDimensions.height(), - newMapDimensions.width(), newMapDimensions.height()); - } } }