Place new events in the center of the map

This commit is contained in:
BigBahss
2021-03-20 11:20:29 -04:00
committed by Tyler Dennis
parent 1c0001504d
commit 5f292ea3cc
3 changed files with 7 additions and 0 deletions

View File

@@ -1551,6 +1551,9 @@ void MainWindow::addNewEvent(QString event_type)
if (editor && editor->project) {
DraggablePixmapItem *object = editor->addNewEvent(event_type);
if (object) {
auto halfSize = ui->graphicsView_Map->size() / 2;
auto centerPos = ui->graphicsView_Map->mapToScene(halfSize.width(), halfSize.height());
object->move(Metatile::coordFromPixmapCoord(centerPos));
updateObjects();
editor->selectMapEvent(object, false);
} else {