Call onMapResized for script changes to map size

This commit is contained in:
GriffinR 2021-12-09 17:50:01 -05:00 committed by huderlem
parent a6395eefbb
commit d00cba3382
2 changed files with 6 additions and 4 deletions

View file

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

View file

@ -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());
}
}
}