From 7ffc8e4f140ac5f5c00e13178e13c2e0cff1af01 Mon Sep 17 00:00:00 2001 From: Acuion Date: Thu, 30 Mar 2017 18:56:52 +0300 Subject: [PATCH] fixed objects offsetting while resizing --- src/tiled/mapdocument.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/tiled/mapdocument.cpp b/src/tiled/mapdocument.cpp index 2a1bf7c911..bf093cb8d2 100644 --- a/src/tiled/mapdocument.cpp +++ b/src/tiled/mapdocument.cpp @@ -348,16 +348,14 @@ void MapDocument::resizeMap(const QSize &size, const QPoint &offset, bool remove case Layer::ObjectGroupType: { ObjectGroup *objectGroup = static_cast(layer); - // Remove objects that will fall outside of the map - if (removeObjects) { - for (MapObject *o : objectGroup->objects()) { - if (!visibleIn(visibleArea, o, mRenderer)) { - new RemoveMapObject(this, o, command); - } else { - QPointF oldPos = o->position(); - QPointF newPos = oldPos + pixelOffset; - new MoveMapObject(this, o, newPos, oldPos, command); - } + for (MapObject *o : objectGroup->objects()) { + if (removeObjects && !visibleIn(visibleArea, o, mRenderer)) { + // Remove objects that will fall outside of the map + new RemoveMapObject(this, o, command); + } else { + QPointF oldPos = o->position(); + QPointF newPos = oldPos + pixelOffset; + new MoveMapObject(this, o, newPos, oldPos, command); } } break;