Scale map appropriately when resizing

This commit is contained in:
GriffinR 2025-05-28 14:20:54 -04:00
parent c26fcdd30f
commit fb3e93be8a

View File

@ -170,9 +170,10 @@ void ResizeLayoutPopup::setupLayoutView() {
layoutPixmap->setBoundary(outline);
emit this->outline->rectUpdated(outline->rect().toAlignedRect());
// TODO: is this an ideal size for all maps, or should this adjust based on starting dimensions?
this->ui->graphicsView->setTransform(QTransform::fromScale(0.5, 0.5));
this->ui->graphicsView->centerOn(layoutPixmap);
QRectF rect = this->outline->rect();
const int marginSize = 10 * 16; // Leave a margin of 10 metatiles around the map
rect += QMargins(marginSize, marginSize, marginSize, marginSize);
this->ui->graphicsView->fitInView(rect, Qt::KeepAspectRatio);
}
void ResizeLayoutPopup::on_spinBox_width_valueChanged(int value) {