svgObjectModelGenerator icon indicating copy to clipboard operation
svgObjectModelGenerator copied to clipboard

Group with shapes having strokes clipped with crema

Open dirkschulze opened this issue 10 years ago • 6 comments

If I export a group that has shapes with strokes in it, then the stroke is clipped at the outer edges of the document. This is because we do not apply the stroke-width/2 offset around the shapes to preserve the stroke. PS does not have this in the boundaries, because inner stroke is the default.

dirkschulze avatar Sep 07 '14 05:09 dirkschulze

@dirkschulze is this in the case when we are isolating a single layer or for a whole document? I don't see the problem if I do an isolated layer export of a single shape (because we do shift the bounds in that case).

jhatwich avatar Sep 07 '14 08:09 jhatwich

I tried it with this example: http://adobe.ly/1xryPBh (which requires issue #51 to be fixed). I exported the group layer and the stroke was clipped. Ot better, the size of the SVG document was smaller than the group + half stroke width.

dirkschulze avatar Sep 07 '14 13:09 dirkschulze

There is a similar-ish issue reported by @dantz in this PSD http://adobe.ly/ZRnTOU the paths are getting clipped for some reason. Can someone investigate? @joebowden

nimbupani avatar Oct 08 '14 19:10 nimbupani

We are padding the bounds appropriately, but the path is not positioned properly within the bounds. This only affects paths, not simple shapes. We should probably stop using the pre-computed SVG path data and render that from raw info. It would be more efficient and would allow us to shift the path as needed.

jhatwich avatar Oct 09 '14 16:10 jhatwich

Hm, but for basic shapes we mostly do that already, no? So are you suggesting to get the actual path data and not the prepared path data? If so, how do we get access to it?

dirkschulze avatar Oct 09 '14 16:10 dirkschulze

Yeah we do it for basic shapes. There is a flag to get the raw path data in getDocumentInfo. I've started using that - if you look at my transforms PR it is using that data to decide whether the shape has been transformed.

jhatwich avatar Oct 09 '14 17:10 jhatwich