Update lyon to 1.0 🎉

Congrats and thanks to @nical!
This commit is contained in:
Héctor Ramón Jiménez 2022-07-11 15:53:33 +02:00
parent d1505a98d9
commit fe34b7a339
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
4 changed files with 8 additions and 9 deletions

View file

@ -42,7 +42,7 @@ path = "../pure"
optional = true
[dependencies.lyon]
version = "0.17"
version = "1.0"
optional = true
[dependencies.qrcode]

View file

@ -144,7 +144,7 @@ impl Frame {
let _ = self
.fill_tessellator
.tessellate_rectangle(
&lyon::math::Rect::new(top_left, size.into()),
&lyon::math::Box2D::new(top_left, top_left + size),
&options,
&mut buffers,
)

View file

@ -10,7 +10,7 @@ pub use builder::Builder;
use crate::canvas::LineDash;
use iced_native::{Point, Size};
use lyon::algorithms::walk::{walk_along_path, RepeatedPattern};
use lyon::algorithms::walk::{walk_along_path, RepeatedPattern, WalkerEvent};
use lyon::path::iterator::PathIterator;
/// An immutable set of points that may or may not be connected.
@ -81,13 +81,12 @@ pub(super) fn dashed(path: &Path, line_dash: LineDash<'_>) -> Path {
walk_along_path(
path.raw().iter().flattened(0.01),
0.0,
lyon::tessellation::StrokeOptions::DEFAULT_TOLERANCE,
&mut RepeatedPattern {
callback: |position: lyon::algorithms::math::Point,
_tangent,
_distance| {
callback: |event: WalkerEvent<'_>| {
let point = Point {
x: position.x,
y: position.y,
x: event.position.x,
y: event.position.y,
};
if draw_line {

View file

@ -8,7 +8,7 @@ use lyon::path::builder::SvgPathBuilder;
/// Once a [`Path`] is built, it can no longer be mutated.
#[allow(missing_debug_implementations)]
pub struct Builder {
raw: lyon::path::builder::WithSvg<lyon::path::path::Builder>,
raw: lyon::path::builder::WithSvg<lyon::path::path::BuilderImpl>,
}
impl Builder {