Skip to content

Conversation

@hongminpark
Copy link

When SVG elements have strokes that extend beyond their viewport bounds, the .clipped() modifier would cut them off. This change allows strokes to render fully outside their nominal bounds.

Problem

When using SVG shapes with strokes, especially with larger stroke widths, the strokes can get clipped at the viewport boundaries. This is because the .clipped() modifier in SVGViewportView forces the content to stay within its frame.

Solution

Remove the .clipped() modifier from SVGViewportView to allow strokes to render beyond the viewport bounds. This maintains the same viewport sizing and transformation behavior while allowing strokes to be fully visible.

Testing

Tested with SVG shapes using various stroke widths and confirmed that:

  • Strokes now render completely without being cut off at the edges
  • The basic viewport sizing and transformation behavior remains unchanged
  • SVG content still respects the frame size for layout purposes

When SVG elements have strokes that extend beyond their viewport bounds,
the .clipped() modifier would cut them off. This change allows strokes
to render fully outside their nominal bounds.
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