feat(movers): add configurable grid snapping and sliding AABB collision solver.#1831
Open
TheMapperJS wants to merge 1 commit into
Open
feat(movers): add configurable grid snapping and sliding AABB collision solver.#1831TheMapperJS wants to merge 1 commit into
TheMapperJS wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds two highly requested quality-of-life options directly to the
/moveuipopup panel: Grid Snapping and Mover Collision. These features significantly enhance the layout customization experience, making UI alignment clean, physical, and satisfying.Key Features
Configurable Grid Snapping (Drag & Drop):
ElvUIGrid) in real-time during dragging and enforces a final, mathematically perfect grid snap upon release.width / gridSize) when the grid size is changed in the move mode popup.2D Sliding AABB Mover Collision:
UIParent,ElvUIParent, andWorldFrame) are filtered out of the loop so movers only block against other actual layout frames.Smart Resolution & Scaling conversions:
UIParent-scale. Snapping and collision boundaries remain pixel-perfect even if custom scales are applied to specific mover frames.Safety & Native Hooks:
Shiftkey while dragging temporarily bypasses all snapping and collision rules for custom overlapping layouts.E.db.general.gridSnapandE.db.general.moverCollisionwith defaults set totrue.Files Modified
Profile.lua: Registered profile defaults forgridSnap = trueandmoverCollision = trueunderP.general.Config.lua: Expanded/moveuipopup window height (from 190 to 215) and added two vertically stacked, styled checkboxes for "Grid Snapping" and "Mover Collision".LibSimpleSticky.lua: ImplementedIsOverlappingandResolveCollisionssliding solvers, and hooked grid snapping and collision checks insideStickyFrames:GetUpdateFunc().Movers.lua: HookedStopMoving(frame)to enforce final snap calculations and commit the exact snapped positions to the layout database to prevent drift on/reload.