Lyon_path usage

Hi! I kind of figure out how to work with widget::canvas, where I have to create a canvas::Path and cover it so it will be ok for fn draw. Now I noticed there are vector graphic tools inside lyon_path. Tutorials have a good demonstration how to build paths, but it’s not clear what to do next. Building inside draw function doesn’t seems to work, as long as lyon_path::Path != canvas::Path, frame can’t take it, and I don’t think I can use it somewhere else. Are there any finished application examples where lyon_path is used?

You don’t need to use lyon_path, you’re supposed to use canvas::Path

Last year I built a toy app for an assignment called pathfinder (pun unintended :sweat_smile:)

Here’s the relevant bit of code to draw the polygons on the board:

Thanks for the fast reply! I have no trouble with using common canvas::Path. But it is fully raster, and I would like to use vector graphic from lyon_path

canvas::Path is vectorial; it gets turned into a lyon path internally before rendering.

1 Like