drawrect2d: support elliptical corners#44
Open
mbouron wants to merge 6 commits into
Open
Conversation
061c6e3 to
37ea1f5
Compare
37ea1f5 to
18178d5
Compare
a465225 to
805a47b
Compare
Rework the dashed-stroke shader so the pattern is uniform, seam-free and properly capped around the whole perimeter, including corners. - Drive every cap style from a single arc-length perimeter coordinate, dropping the butt cap's AABB nearest-edge heuristic whose iso-t lines kinked along the corner diagonal and sliced any dash landing there. - Snap the dash period so a whole number of periods fit the perimeter. The requested length rarely divides it evenly, which left a partial dash at the wrap point that slid around (and popped in and out) whenever the length changed; the snapped pattern closes on itself. - Compute round caps in true 2D. A dash is the stroke of a centerline segment: the body is the perpendicular stroke distance, the ends are disks around the segment endpoints recovered from their arc length (ngli_perim_point). This keeps caps circular where the perimeter curves, instead of the distortion of an unrolled (arc-length, perpendicular) capsule. - Run the round-cap path along the stroke centerline (boundary offset by the stroke position) so a convex corner rounds by that offset: an outside stroke now turns a sharp corner with a smooth join rather than a square block. Butt/square caps keep the boundary inflated to half the stroke width, enough corner arc for a seam-free t. - Skip the round-cap endpoint evaluation for fragments farther than the stroke half-width from the centerline (the bulk of the quad), where no cap can reach and the dash contribution is zero anyway, and only take the arc-length-derivative AA width in the butt/square branches that use it. Both are pixel-exact (refs unchanged). dash_length is now documented as a target that is snapped to tile evenly, and the dashed-stroke refs are regenerated to match.
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.
No description provided.