Skip to content

Commit 65be7ca

Browse files
committed
fix errors
1 parent 56d5db6 commit 65be7ca

2 files changed

Lines changed: 0 additions & 59 deletions

File tree

src/drawing.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ pub enum DrawingElement {
6666
rough_style: Option<crate::rough::RoughOptions>,
6767
style: Style,
6868
},
69-
Diamond {
70-
position: [f32; 2],
71-
size: [f32; 2],
72-
color: [f32; 4],
73-
fill: bool,
74-
stroke_width: f32,
75-
rough_style: Option<crate::rough::RoughOptions>,
76-
},
7769
Arrow {
7870
start: [f32; 2],
7971
end: [f32; 2],

src/event_handler.rs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -606,36 +606,6 @@ impl State {
606606
None
607607
}
608608
}
609-
Tool::Diamond => {
610-
if let Some(start) = self.input.drag_start {
611-
let end = self.canvas.transform.screen_to_canvas(self.input.mouse_pos);
612-
let position = [start[0].min(end[0]), start[1].min(end[1])];
613-
let size = [(end[0] - start[0]).abs(), (end[1] - start[1]).abs()];
614-
615-
let mut rough_options = crate::rough::RoughOptions::default();
616-
rough_options.stroke_width = self.stroke_width;
617-
618-
let mut rng = rand::rng();
619-
620-
rough_options.roughness = 0.6 + rng.random::<f32>() * 0.8;
621-
rough_options.bowing = 0.4 + rng.random::<f32>() * 0.6;
622-
rough_options.max_randomness_offset = 1.0 + rng.random::<f32>() * 1.0;
623-
rough_options.curve_tightness = rng.random::<f32>() * 0.2;
624-
625-
rough_options.seed = Some(rng.random::<u64>());
626-
627-
Some(DrawingElement::Diamond {
628-
position,
629-
size,
630-
color: self.current_color,
631-
fill: false,
632-
stroke_width: self.stroke_width,
633-
rough_style: Some(rough_options),
634-
})
635-
} else {
636-
None
637-
}
638-
}
639609
_ => None,
640610
};
641611

@@ -758,27 +728,6 @@ impl State {
758728
});
759729
}
760730
}
761-
Tool::Diamond => {
762-
if let Some(start) = self.input.drag_start {
763-
let end = self.canvas.transform.screen_to_canvas(self.input.mouse_pos);
764-
let position = [start[0].min(end[0]), start[1].min(end[1])];
765-
let size = [(end[0] - start[0]).abs(), (end[1] - start[1]).abs()];
766-
767-
self.input.preview_element = Some(DrawingElement::Diamond {
768-
position,
769-
size,
770-
color: [
771-
self.current_color[0],
772-
self.current_color[1],
773-
self.current_color[2],
774-
0.5,
775-
],
776-
fill: false,
777-
stroke_width: self.stroke_width,
778-
rough_style: None,
779-
});
780-
}
781-
}
782731
_ => {
783732
self.input.preview_element = None;
784733
}

0 commit comments

Comments
 (0)