Sketcher: preserve local overlay depth for dimensions and grid#29280
Merged
hyarion merged 2 commits intoFreeCAD:mainfrom Apr 11, 2026
Merged
Sketcher: preserve local overlay depth for dimensions and grid#29280hyarion merged 2 commits intoFreeCAD:mainfrom
hyarion merged 2 commits intoFreeCAD:mainfrom
Conversation
Collaborator
|
Successfully created backport PR for |
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.
This fixes depth layering for face-attached sketches in edit mode.
The branch does two things:
Problem
When editing a sketch attached to a face, dimension/helper lines could disappear behind the model geometry.
The underlying issue was that some
SoDatumLabeldrawing paths usedglVertex2f(...), which discards the incoming Z coordinate. That flattened those lines onto the sketch plane instead of using the local Sketcher overlay depth that had already been assigned upstream.With depth testing enabled, those lines could then lose against the support face.
After correcting that, the grid exposed the same problem from the opposite direction: it was still generated directly on the support plane, so it rendered behind the face while dimensions were correctly using their local overlay depth.
Fix
Preserve local Z for dimension lines
In
src/Gui/SoDatumLabel.cpp, the affected dimension/helper line paths now use the full 3D input points instead of dropping Z.This makes those lines render at the same local Sketcher overlay depth they already receive from the constraint code, including the correct front/back behavior.
Lift the grid off the support face
In
src/Mod/Part/Gui/ViewProviderGridExtension.cpp, the grid is now emitted with a small local Z offset toward the active viewing side instead of being placed directly on the support plane.This keeps the grid visible while still leaving it below the rest of the sketch overlay.
Result
Fixes #27924