From e835cea03c5d6eeba2d76b52206516dcc2a6b628 Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Thu, 27 Jan 2022 09:40:52 -0800 Subject: Add line dash API --- examples/solar_system/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples') diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs index 5f9724f3..0e7da97f 100644 --- a/examples/solar_system/src/main.rs +++ b/examples/solar_system/src/main.rs @@ -163,6 +163,10 @@ impl canvas::Program for State { Stroke { width: 1.0, color: Color::from_rgba8(0, 153, 255, 0.1), + line_dash: canvas::LineDash { + offset: 0, + segments: vec![6.0, 3.0], + }, ..Stroke::default() }, ); -- cgit From 39800b445f135211504b18bbc03ab9840198a64f Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Thu, 27 Jan 2022 10:01:16 -0800 Subject: Increase gap in example --- examples/solar_system/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs index 0e7da97f..fb782d9c 100644 --- a/examples/solar_system/src/main.rs +++ b/examples/solar_system/src/main.rs @@ -165,7 +165,7 @@ impl canvas::Program for State { color: Color::from_rgba8(0, 153, 255, 0.1), line_dash: canvas::LineDash { offset: 0, - segments: vec![6.0, 3.0], + segments: vec![3.0, 6.0], }, ..Stroke::default() }, -- cgit From 76c03de58729783513504f8115d7381f9a52fd23 Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Thu, 27 Jan 2022 10:04:23 -0800 Subject: Fix examples, no longer Copy --- examples/clock/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs index 325ccc1a..fce57cc0 100644 --- a/examples/clock/src/main.rs +++ b/examples/clock/src/main.rs @@ -100,14 +100,14 @@ impl canvas::Program for Clock { let wide_stroke = Stroke { width: thin_stroke.width * 3.0, - ..thin_stroke + ..thin_stroke.clone() }; frame.translate(Vector::new(center.x, center.y)); frame.with_save(|frame| { frame.rotate(hand_rotation(self.now.hour(), 12)); - frame.stroke(&short_hand, wide_stroke); + frame.stroke(&short_hand, wide_stroke.clone()); }); frame.with_save(|frame| { -- cgit From f56c8a7361ceb215bce68e88bd6ce402e2694693 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 3 Feb 2022 17:18:05 +0700 Subject: Ask for a slice of segments instead of ownership in `LineDash` --- examples/clock/src/main.rs | 4 ++-- examples/solar_system/src/main.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs index fce57cc0..325ccc1a 100644 --- a/examples/clock/src/main.rs +++ b/examples/clock/src/main.rs @@ -100,14 +100,14 @@ impl canvas::Program for Clock { let wide_stroke = Stroke { width: thin_stroke.width * 3.0, - ..thin_stroke.clone() + ..thin_stroke }; frame.translate(Vector::new(center.x, center.y)); frame.with_save(|frame| { frame.rotate(hand_rotation(self.now.hour(), 12)); - frame.stroke(&short_hand, wide_stroke.clone()); + frame.stroke(&short_hand, wide_stroke); }); frame.with_save(|frame| { diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs index fb782d9c..12184dd1 100644 --- a/examples/solar_system/src/main.rs +++ b/examples/solar_system/src/main.rs @@ -165,7 +165,7 @@ impl canvas::Program for State { color: Color::from_rgba8(0, 153, 255, 0.1), line_dash: canvas::LineDash { offset: 0, - segments: vec![3.0, 6.0], + segments: &[3.0, 6.0], }, ..Stroke::default() }, -- cgit