simple-svg icon indicating copy to clipboard operation
simple-svg copied to clipboard

added optional open/close parameter to startNewSubPath

Open Hannobal opened this issue 4 years ago • 1 comments

I often want to use paths without a fill, but with multiple sub-paths that share the Stroke style (e.g. to plot a maze). So I added an optional parameter to startNewSubPath, that is either Open or Closed. Since the default is Closed, the old behavior is preserved. I used an enum to make the using code more expressive, i.e.

path.startNewSubPath(Open);

instead of

path.startNewSubPath(false);

Hannobal avatar Oct 13 '21 20:10 Hannobal

Thanks for the review. I made the changes you suggested. Using the enum throughout is certainly more explicit. I was unsure if I should add the static_cast<bool>. It probably isn't necessary but it certainly doesn't hurt either.

Hannobal avatar Oct 17 '21 05:10 Hannobal