@@ -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