Skip to content

Preserve Z values at line intersections instead of zeroing them#1064

Open
Nebukam wants to merge 1 commit intoAngusJohnson:mainfrom
Nebukam:main
Open

Preserve Z values at line intersections instead of zeroing them#1064
Nebukam wants to merge 1 commit intoAngusJohnson:mainfrom
Nebukam:main

Conversation

@Nebukam
Copy link

@Nebukam Nebukam commented Feb 6, 2026

When USINGZ is enabled, GetLineIntersectPt sets ip.z = 0 for true intersection points (where t is strictly between 0 and 1). This discards user data stored in Z before the ZCallback has a chance to run, which matters for code paths like RectClip that don't use a ZCallback at all. Pick the nearer endpoint's Z value instead.

When USINGZ is enabled, GetLineIntersectPt sets ip.z = 0 for true intersection points (where t is strictly between 0 and 1). This discards user data stored in Z before the ZCallback has a chance to run, which matters for code paths like RectClip that don't use a ZCallback at all. Pick the nearer endpoint's Z value instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant