-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Make Gizmos::rect_2d draw the joint of the upper left corner of the rectangle #22080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Gizmos::rect_2d to ensure that the line joint on the top left corner is drawn.
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
alice-i-cecile
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love that we're double-drawing the one line segment, but this is a very unobtrusive fix. Are other polygons affected?
|
I don't love the double drawing either, but I didn't spot any underlying mechanism for drawing closed shapes. Not sure about other polygons---I found this in the context of drawing a selection box. I'll check.. |
|
|
Agreed, this would be my preference. We could fix #22081 in earnest, and then resolve all of these problems at once. |
|
Closing this in favor of #22085. |

Make
Gizmos::rect_2ddraw the joint of the upper left corner of the rectangleObjective
Gizmos::rect_2ddoes not draw the line joint between the left and top line segments. This looks odd when the line joint is notGizmoLineJoint::None.Solution
Gizmos::rect_2ddraws the rectangle usingGizmos::linestrip_2d, which doesn't draw a closed shape.linestrip_2dto draw a joint at a corner, that corner has to be in the points list with a predecessor and a successor.tlhas no predecessor when it's the first element in the list, and no successor when it's the last.trto the list is enough to puttlbetween two other points, which causes the joint to be rendered.Testing
The test code is just this, and observing the result captured in the screenshots below:
Showcase
Incorrect
GizmoLineJoint::Miterjoint without this change:Correct
GizmoLineJoint::Miterjoint with this change: