Skip to content

Clipping of SVG strokes  #175

Open
@paulkaplan

Description

@paulkaplan

Expected Behavior

Please describe what should happen

screen shot 2017-10-03 at 8 57 59 am

Actual Behavior

Describe what actually happens

screen shot 2017-10-03 at 8 57 47 am

Steps to Reproduce

Explain what someone needs to do in order to see what's described in Actual behavior above

Those screenshots are from importing a simple SVG with a somewhat thicker stroke width set. This is the SVG I used:

<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
    <circle r="50" cx="50" cy="50" stroke-width="5" stroke="black" fill="none" />
</svg>

I have seen this in a number of real-world projects as well, for example https://scratch.mit.edu/projects/22508123/. This also came up when trying to design think/say bubbles in SVG. They get clipped in the same way.

We use svg.getBBox() to calculate the width/height of the svg, which only uses the geometry of the elements and not visual styles like stroke-width (source). I'm not sure how we can solve this...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions