simple-svg
simple-svg copied to clipboard
added optional open/close parameter to startNewSubPath
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);
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.