mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-30 03:46:35 -05:00
Place new events in the center of the map
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user