Skip to content

Conversation

@waywardmonkeys
Copy link
Contributor

This is an optional feature, not enabled by default.

@waywardmonkeys
Copy link
Contributor Author

This is most usable when it is able to use From impls, so having it here in the kurbo crate is easiest to use.

This is still missing support for various types.

It might be that the features should change so that they're objc2-core-foundation for the core types (affine, point, rect, size, vec) and objc2-core-graphics for the things like line caps, joins, paths, etc. There should also be support for UIBezierPath and NSBezierPath (which are 2 other crates).

This is an optional feature, not enabled by default.
@waywardmonkeys
Copy link
Contributor Author

@xStrom What might be the best way to handle a feature that only works on a subset of platforms?

Copy link
Member

@xStrom xStrom left a comment

Choose a reason for hiding this comment

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

To solve this at the CI level we would have to use cargo-hack for everything, including testing. However, I think we should solve this at a different level because being able to use --all-features locally for development is very nice.

What I think we should do is make this feature a NOP on other platforms. Then --all-features will continue working and no changes will be needed to CI either.

Comment on lines +46 to +56
[dependencies.objc2-core-foundation]
version = "0.3.1"
optional = true
default-features = false
features = ["CFCGTypes"]

[dependencies.objc2-core-graphics]
version = "0.3.1"
optional = true
default-features = false
features = ["CGPath"]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
[dependencies.objc2-core-foundation]
version = "0.3.1"
optional = true
default-features = false
features = ["CFCGTypes"]
[dependencies.objc2-core-graphics]
version = "0.3.1"
optional = true
default-features = false
features = ["CGPath"]
[target.'cfg(target_vendor = "apple")'.dependencies.objc2-core-foundation]
version = "0.3.1"
optional = true
default-features = false
features = ["CFCGTypes"]
[target.'cfg(target_vendor = "apple")'.dependencies.objc2-core-graphics]
version = "0.3.1"
optional = true
default-features = false
features = ["CGPath"]

Comment on lines +145 to +146
#[cfg(feature = "objc2-core-graphics")]
mod interop_objc2_core_graphics;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#[cfg(feature = "objc2-core-graphics")]
mod interop_objc2_core_graphics;
#[cfg(all(target_vendor = "apple", feature = "objc2-core-graphics"))]
mod interop_objc2_core_graphics;

github-merge-queue bot pushed a commit that referenced this pull request Jul 11, 2025
Inspired after #450

We could use those in servo and blitz.
Theoretically they could also live in euclid, but given higher number of
breaking releases in kurbo, kurbo seems better place for this.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
flaviotore added a commit to flaviotore/kurbo that referenced this pull request Oct 9, 2025
Inspired after linebender/kurbo#450

We could use those in servo and blitz.
Theoretically they could also live in euclid, but given higher number of
breaking releases in kurbo, kurbo seems better place for this.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
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