bevyengine / bevyengine/bevy

Draw joints for closed shapes without redrawing the first line segment

Open
#22,095 1 comment 0 reactions 0 assignees View on GitHub
A-Gizmos C-Code-Quality D-Modest X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

#22085 added `Gizmos::lineloop_2d` for drawing closed shapes, and made all the closed shapes with sharp corners use it. This fixed #22081, in which the joint was missing on the first corner of closed shapes.

The simple solution in #22085 was to redraw the first line segment at the end of the line strip. This works, but involves unnecessary drawing. A better solution would be to draw the first joint without overdrawing the first segment.

Contributor guide

Open the contributing guide

Research direction

Start by reading the implementation of Gizmos::lineloop_2d and the closed-shape changes from #22085, then inspect how the first joint is currently produced. The work is done when closed shapes retain the first-corner joint without redrawing the first line segment, while preserving the fix for #22081.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.