Skip to content

Several fixes related to resizing maps - #4609

Open
bjorn wants to merge 3 commits into
masterfrom
fix-map-resizing
Open

Several fixes related to resizing maps#4609
bjorn wants to merge 3 commits into
masterfrom
fix-map-resizing

Conversation

@bjorn

@bjorn bjorn commented Sep 10, 2026

Copy link
Copy Markdown
Member

Three fixes related to resizing maps, both through the Resize Map dialog and with the World Tool:

  • Image layers ended up at the wrong position after a map resize on non-orthogonal maps. Their offset was adjusted by the pixel offset, but image layers are positioned in screen coordinates relative to the map's bounding rect. They are now moved by the shift of that bounding rect, which is the same offset already used to adjust the map's world position.

  • Resizing hexagonal and staggered maps with the World Tool skipped rows. The drag was snapped to the tile size and then converted to whole rows and columns, but a row of such a map adds less than a tile on screen, so a row was skipped every few rows. The drag now snaps directly to the on-screen size of one column or row, unless snapping to the world grid is enabled.

  • The World Tool selection rectangle went stale when the target map was resized by undo or redo. The rectangle and handles only followed the tool's own resizes and world changes, so undoing a resize left them in place until the next mouse event. The tool now follows the target map's resize signal. The target is also held in a QPointer, since it can be a neighbouring map that is closed while targeted.

The offset of image layers was adjusted by the pixel offset, but image
layers are positioned in screen coordinates relative to the map's
bounding rect.

Image layers are now moved by the shift of the bounding rect, which is
the same offset already used to adjust the map's position in a world.
The resize drag of the World Tool was snapped to the tile size and then
converted to whole rows and columns, but a row of a hexagonal or
staggered map adds less than a tile on screen. This skipped a row every
few rows.

The drag now snaps directly to the on-screen size of one column or row,
unless snapping to the world grid is enabled.
The rectangle and resize handles around the hovered map only followed
the tool's own resizes and world changes. Undoing or redoing a resize
left them stale until the next mouse event.

The tool now connects to the target map's mapResized signal. The target
is held in a QPointer, since it can be a document other than the
current one and may be closed while targeted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant