Nilirad/bevy_prototype_lyon

`Path` no longer implement `Geometry`?

jcornaz opened this issue · 2 comments

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?

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.

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