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

Path no longer implement Geometry? #138

Closed
jcornaz opened this issue Jan 9, 2022 · 2 comments · Fixed by #139
Closed

Path no longer implement Geometry? #138

jcornaz opened this issue Jan 9, 2022 · 2 comments · Fixed by #139

Comments

@jcornaz
Copy link

jcornaz commented Jan 9, 2022

It looks like in 0.4.0 Path no longer implement Geometry.

As a result this code, which used to compile, no longer do:

GeometryBuilder::new().add(&PathBuilder::new().build());

I don't see any related information in the changelog. Was that on purpose? If yes, what is the new way to add an arbitrary path to the GeometryBuilder?

@Nilirad
Copy link
Owner

Nilirad commented Jan 9, 2022

I had to use Path (defined in a dependency) as a component. Since I couldn't implement Component on it, i wrapped it into a local Path struct.

Unfortunately, i forgot to implement Geometry for the wrapper Path. I'll fix it for the next release. In the meantime, you can use the following:

GeometryBuilder::new().add(&PathBuilder::new().build().0);

the .0 unwraps the inner lyon Path that implements Geometry.

@Nilirad Nilirad linked a pull request Jan 9, 2022 that will close this issue
Nilirad referenced this issue Jan 11, 2022
* Move `Geometry` impl to wrapper `Path`

* Add path example
@CleanCut
Copy link

I hit this today! I was so confused. I'm glad I looked through the closed issues here!

Just to improve the searchability of this issue, here is the specific error(s):

the trait `Geometry` is not implemented for `bevy_prototype_lyon::entity::Path`
...
required by this bound in `bevy_prototype_lyon::geometry::GeometryBuilder::build_as`
(or)
required by this bound in `bevy_prototype_lyon::geometry::GeometryBuilder::add

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 a pull request may close this issue.

3 participants