Keep text and images in place when resized on defense (#226)

* Keep text and images in place when resized on defense

On defense a text box or image mirrors attack, so it hangs from its
bottom-right corner. Dragging the right-hand resize handle moved the
left edge instead, and because the width was measured from that moving
edge, the box ran away from the pointer.

A resize now pins the box's on-screen top-left, and on release stores
the size together with the canonical position that keeps it there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Pass the side into text and image builders

The lists already know which side is showing, so hand it down instead of
reading mapProvider in each builder. On main, mapProvider reads Hive-backed
preferences, which widget tests of the builders do not open.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Move the resize pin with a mid-drag side switch

Switching sides while holding a resize handle left the pin at the old
side's screen position, and release read it on the new side, so the
stored position landed hundreds of pixels off. The pin now moves to
where the box shows on the new side.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Keep the resize width tracking the pointer after a side switch

A side switch mid-resize mirrors the box away from the held pointer, and
the next drag update measured the width from the new left edge, so the
box jumped hundreds of pixels wide. The builders now remember how far
the left edge moved and measure from where it was.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
4bb0050450Dara Adedeji committed on 9/29/2026, 5:32:07 AM· committed by GitHubparent6f29281
8 files changedLine totals unavailable