Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join multiple paths #66

Open
lunabunn opened this issue Dec 30, 2022 · 5 comments
Open

Join multiple paths #66

lunabunn opened this issue Dec 30, 2022 · 5 comments

Comments

@lunabunn
Copy link

I am looking to join multiple closed paths together so that they can be drawn together. It seems that tiny-skia does not provide a simple way to do this, and one must therefore resort to manually iterating over path segments and using PathBuilder.

Is this indeed the case? If so, perhaps something like Path::join or PathBuilder::push_path could be added? If not, what am I missing?

@RazrFalcon
Copy link
Collaborator

Yes, we should make PathBuilder::push_path public. And we can add a similar method to Path as well.

@lunabunn
Copy link
Author

Yes, we should make PathBuilder::push_path public. And we can add a similar method to Path as well.

The current private PathBuilder::push_path method actually takes a PathBuilder (and not a Path), which I am not sure would be very useful in a public API.

Ideally, the current PathBuilder::push_path should be renamed to something like PathBuilder::push_path_builder and kept private. A new public PathBuilder::push_path could then be added to do the same thing but with an actual Path. As you said, I think we can add a pub fn join(self, other: Path) -> Path method to Path as well.

If you'd be cool with something along these lines, I can create a PR and we can bikeshed from there (as necessary)?

@RazrFalcon
Copy link
Collaborator

Sure, sounds good.

@lunabunn
Copy link
Author

Just an update: I don't actually need this anymore in my project and I have limited time lately, so I cannot make any guarantees as to when that PR is coming :(

I will probably get to it at some point. In the meantime, if anyone else wants to work on it, please feel more than free to do so unannounced.

@RazrFalcon
Copy link
Collaborator

No problem. I will add it eventually, when I would have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants