The nannou::geom::path::Builder doesn't expose the internal lyon::path::path::Builder's end method, which leads to validation panics when a path is built outside of release mode. Reproducable example (must be run without --release, Lyon's path validator is turned off if the flag is enabled):
use nannou::prelude::*;
use nannou::geom::path;
fn main() {
let mut builder = path();
builder = builder.begin(vec2(-50.0, 0.0));
builder = builder.quadratic_bezier_to(vec2(0.0, 25.0), vec2(50.0, 0.0));
let _path = builder.build();
}
Since Lyon's Builder::end isn't exposed by Nannou, the only clearly documented way out is with close, but that's undesirable as it forces a closed loop. A workaround for this is to use path.inner_mut().end(false);, but for convenience this PR adds it to the Builder directly.
Requiring paths to be properly ended before build was added in Lyon v0.17. I see that an end method was correctly added with the version bump, but it wasn't published.
The
nannou::geom::path::Builder
doesn't expose the internallyon::path::path::Builder
'send
method, which leads to validation panics when a path is built outside of release mode. Reproducable example (must be run without--release
, Lyon's path validator is turned off if the flag is enabled):Since Lyon's
Builder::end
isn't exposed by Nannou, the only clearly documented way out is withclose
, but that's undesirable as it forces a closed loop. A workaround for this is to usepath.inner_mut().end(false);
, but for convenience this PR adds it to the Builder directly.Requiring paths to be properly ended before
build
was added in Lyon v0.17. I see that anend
method was correctly added with the version bump, but it wasn't published.Resolves #933