Skip to content

Commit bbc45ae

Browse files
committed
almost finalized dotted lines
1 parent 65be7ca commit bbc45ae

4 files changed

Lines changed: 657 additions & 87 deletions

File tree

src/event_handler.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ impl State {
9595
return true;
9696
}
9797

98+
if let Some(style) =
99+
self.ui_renderer.handle_style_click(self.input.mouse_pos)
100+
{
101+
self.current_style = style;
102+
return true;
103+
}
104+
98105
if self.ui_renderer.is_mouse_over_ui(
99106
self.input.mouse_pos,
100107
(self.size.width as f32, self.size.height as f32),
@@ -463,6 +470,7 @@ impl State {
463470

464471
let mut rough_options = crate::rough::RoughOptions::default();
465472
rough_options.stroke_width = self.stroke_width;
473+
rough_options.dotted = self.current_style == crate::drawing::Style::Dotted;
466474

467475
let mut rng = rand::rng();
468476

@@ -493,6 +501,7 @@ impl State {
493501

494502
let mut rough_options = crate::rough::RoughOptions::default();
495503
rough_options.stroke_width = self.stroke_width;
504+
rough_options.dotted = self.current_style == crate::drawing::Style::Dotted;
496505

497506
let mut rng = rand::rng();
498507

@@ -523,6 +532,7 @@ impl State {
523532

524533
let mut rough_options = crate::rough::RoughOptions::default();
525534
rough_options.stroke_width = self.stroke_width;
535+
rough_options.dotted = self.current_style == crate::drawing::Style::Dotted;
526536

527537
let mut rng = rand::rng();
528538

@@ -552,6 +562,7 @@ impl State {
552562

553563
let mut rough_options = crate::rough::RoughOptions::default();
554564
rough_options.stroke_width = self.stroke_width;
565+
rough_options.dotted = self.current_style == crate::drawing::Style::Dotted;
555566

556567
let mut rng = rand::rng();
557568

@@ -583,6 +594,7 @@ impl State {
583594

584595
let mut rough_options = crate::rough::RoughOptions::default();
585596
rough_options.stroke_width = self.stroke_width;
597+
rough_options.dotted = self.current_style == crate::drawing::Style::Dotted;
586598

587599
let mut rng = rand::rng();
588600

0 commit comments

Comments
 (0)