sprite sheet maker
Clamp a dragged sprite against the bounds the editor displays
A level editor draws its allowed region in scene coordinates. A draggable actor lives under a shifted or scaled parent. If the editor clamps the submitted parent-space point directly against scene limits, the on-screen border and the point where dragging stops can differ.
Test one centered drag and one outside each boundary under a parent with a visible translation and scale. Map the proposed anchor into the scene coordinates used by the guide box. Compare and clamp there, then convert the result back to the parent space before returning it. Display the requested world point and accepted world point as different colored markers in the debug view. The accepted marker should sit on the border for each out-of-range move. If the sprite’s whole rectangle needs to stay visible, use a separate test for its extents.
The technical guide and test fixture records a Qt 6.8.3 fixture where the corrected position takes effect after enabling ItemSendsGeometryChanges and returning it from ItemPositionChange.
Review one programmatic move along with pointer dragging. Both should respect the same boundary contract when both use the item’s position change path.
Prepared by the FrameSprite Workflow Team with AI assistance. Examples are illustrative unless attributed to a linked fixture.