Skip to content

Conversation

@msvbg
Copy link
Contributor

@msvbg msvbg commented Aug 28, 2024

Sister PR to tirithen/clipper2c-sys#6. Adds a usingz cargo feature to support user data in points.

I think the main complication is the double Box dance to be able to pass Rust closures as a C callback. I think this is a nicer API than just a function pointer, which would also leak clipper2c-sys internal types.

Cargo.toml Outdated
features = ["doc-images"]

[patch.crates-io]
clipper2c-sys = { rev = "210878394637f94bcd3a476bdf24ddf4ba8a39fd", git = "https://github.com/tirithen/clipper2c-sys" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: fix this before merging

@msvbg msvbg force-pushed the usingz branch 3 times, most recently from 1d9fa1f to 72d7dc3 Compare August 28, 2024 14:08
@msvbg
Copy link
Contributor Author

msvbg commented Aug 29, 2024

One problem with this PR is that it breaks e.g. scale_around_point since it uses the Point::new API instead of Point::new_with_z. Maybe the cleanest way to solve this is to have two types, one Point type and a PointZ type or something instead of putting #[cfg(feature = "usingz")] everywhere around the code base.

@songhuaixu
Copy link

songhuaixu commented Sep 3, 2024

One problem with this PR is that it breaks e.g. scale_around_point since it uses the Point::new API instead of Point::new_with_z. Maybe the cleanest way to solve this is to have two types, one Point type and a PointZ type or something instead of putting #[cfg(feature = "usingz")] everywhere around the code base.

I think using PointZ might be better

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

Successfully merging this pull request may close these issues.

2 participants