Zoom In/Out #37
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: SketchyMaze/doodle#37
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This feature's been challenging and chipped away at slowly over time.
Zooming In and Out in the level editor involves a lot of moving parts:
Current Outstanding Issues
Scrolling into negative level coordinatesFrom the default scroll position at 0,0 if you zoom Out a level, all the level to the right and below are visible at once.
As you scroll Left or Up into negative world coordinates, you'd expect the level chunks directly to the left of what was visible to appear. But you need to scroll much further left before chunks for negative level coordinates begin appearing.
It likely may need some inverted behavior when calling ZoomMultiply() on the chunk coordinate.
Can not draw reliably while zoomedWhen zoomed in or out, coordinates don't translate properly when you attempt to draw new pixels onto the level. The current user experience is:
It seems to be a miscalculation somewhere, the WorldIndexAt() fix in
37f6177a17
may help: it can now accurately map an on-screen mouse cursor position to a world index while zoomed.Creeping Disappearing ChunksThe default chunk size in levels is 128x128 pixels.
When you zoom the level up two times (200% zoom), each of those chunks displays as 256x256 pixels on screen. As you begin scrolling right or down, all is good until you reach 128 pixels in either direction.
At 128 pixels down, the whole top row of chunks unloads; given the Viewport scroll position was 128 and it asked for level chunks within Y=128, and the chunk at (0,0) ended at Y=127, it doesn't get this chunk coordinate to loop over. The chunk wasn't in the viewport per world coordinates, though half of its image was still visible on screen.
Solutions tried:
Actors do not scaleWhen zoomed in or out, actors remain visually on-screen in exactly the same spot they were, they do not change with the level.
It should need:
Lowest priority of all the issues.
Link lines do not draw correctlyAs the doodads in the level move position and size during zoom, the pink lines connecting linked doodads together don't move at all. They still point to positions on screen where doodads would have been without zooming.
Actor Hitboxes for Actor/Link ToolWhen the Actor Tool or Link Tool is selected, actors in your level should outline in orange or pink on mouse hover. This was not scaling up correctly when zoomed in.
If scrolled to 0,0 (default) all was fine when zoomed, but as the level scrolled the hitboxes would drift apart.