Open gverger opened 1 year ago
Making the second cut changes the nature of the shape from a single shape to a GROUP shape (now having 2 child shapes).
During shape boolean operations, PGS creates a new, non-stylised shape. To preserve styling (color, fill, etc.) it then copies the style of the input shape to the new shape.
In your case the new shape is a GROUP shape and the apply styling operation is happening to the group shape, but that doesn't automatically apply styling to child shapes -- I suppose this is an oversight in the code.
For now you can use this to get the styling as intended:
// display on right side
PGS_Conversion.disableAllStroke(outer); // applies to all child shapes
PGS_Conversion.setAllFillColor(outer, #505050); // applies to all child shapes
shape(outer, 250, 0);
Thanks, that makes sense. It seems surprising when you are not familiar with the internals of it, especially when I see that PRESERVE_STYLE
is true.
From my novice point of view I would have expected that these 2 lines you provided are somehow automatically applied.
Anyway, for my current usage, I'll manage with this workaround, feel free to close this issue if you consider you won't touch the current behavior.
Thanks again!
From my novice point of view I would have expected that these 2 lines you provided are somehow automatically applied.
Yes, I agree. It's oversight in the code and I'll fix it.
Hello,
Your library is (almost) a life savior for me, thanks!
I have an issue with a shape that I want to create. I want so subtract several rectangles from a circle, like so:
I would expect the result to be the same as the second shape + one more hole, but it loses its color. Is there a limitation in subtractions, or did I discover a bug?
Thank you!