@@ -476,7 +476,7 @@ impl Fsm for ShapeToolFsmState {
476476
477477 if matches ! ( self , ShapeToolFsmState :: Drawing ( _) | ShapeToolFsmState :: DraggingLineEndpoints ) {
478478 Line :: overlays ( document, tool_data, & mut overlay_context) ;
479- if matches ! ( tool_options. shape_type, ShapeType :: Circle ) {
479+ if tool_options. shape_type == ShapeType :: Circle {
480480 tool_data. gizmo_manager . overlays ( document, input, shape_editor, mouse_position, & mut overlay_context) ;
481481 }
482482 }
@@ -657,7 +657,7 @@ impl Fsm for ShapeToolFsmState {
657657 } ;
658658
659659 match tool_data. current_shape {
660- ShapeType :: Polygon | ShapeType :: Star | ShapeType :: Ellipse | ShapeType :: Arc | ShapeType :: Rectangle | ShapeType :: Circle => tool_data. data . start ( document, input) ,
660+ ShapeType :: Polygon | ShapeType :: Star | ShapeType :: Circle | ShapeType :: Arc | ShapeType :: Rectangle | ShapeType :: Ellipse => tool_data. data . start ( document, input) ,
661661 ShapeType :: Line => {
662662 let point = SnapCandidatePoint :: handle ( document. metadata ( ) . document_to_viewport . inverse ( ) . transform_point2 ( input. mouse . position ) ) ;
663663 let snapped = tool_data. data . snap_manager . free_snap ( & SnapData :: new ( document, input) , & point, SnapTypeConfiguration :: default ( ) ) ;
@@ -670,11 +670,11 @@ impl Fsm for ShapeToolFsmState {
670670 let node = match tool_data. current_shape {
671671 ShapeType :: Polygon => Polygon :: create_node ( tool_options. vertices ) ,
672672 ShapeType :: Star => Star :: create_node ( tool_options. vertices ) ,
673+ ShapeType :: Circle => Circle :: create_node ( ) ,
673674 ShapeType :: Arc => Arc :: create_node ( tool_options. arc_type ) ,
674675 ShapeType :: Rectangle => Rectangle :: create_node ( ) ,
675676 ShapeType :: Ellipse => Ellipse :: create_node ( ) ,
676677 ShapeType :: Line => Line :: create_node ( document, tool_data. data . drag_start ) ,
677- ShapeType :: Circle => Circle :: create_node ( ) ,
678678 } ;
679679
680680 let nodes = vec ! [ ( NodeId ( 0 ) , node) ] ;
@@ -683,7 +683,7 @@ impl Fsm for ShapeToolFsmState {
683683 let defered_responses = & mut VecDeque :: new ( ) ;
684684
685685 match tool_data. current_shape {
686- ShapeType :: Ellipse | ShapeType :: Rectangle | ShapeType :: Arc | ShapeType :: Polygon | ShapeType :: Star | ShapeType :: Circle => {
686+ ShapeType :: Polygon | ShapeType :: Star | ShapeType :: Circle | ShapeType :: Arc | ShapeType :: Rectangle | ShapeType :: Ellipse => {
687687 defered_responses. add ( GraphOperationMessage :: TransformSet {
688688 layer,
689689 transform : DAffine2 :: from_scale_angle_translation ( DVec2 :: ONE , 0. , input. mouse . position ) ,
@@ -715,13 +715,13 @@ impl Fsm for ShapeToolFsmState {
715715 } ;
716716
717717 match tool_data. current_shape {
718- ShapeType :: Rectangle => Rectangle :: update_shape ( document, input, layer, tool_data, modifier, responses) ,
719- ShapeType :: Ellipse => Ellipse :: update_shape ( document, input, layer, tool_data, modifier, responses) ,
720- ShapeType :: Line => Line :: update_shape ( document, input, layer, tool_data, modifier, responses) ,
721718 ShapeType :: Polygon => Polygon :: update_shape ( document, input, layer, tool_data, modifier, responses) ,
722719 ShapeType :: Star => Star :: update_shape ( document, input, layer, tool_data, modifier, responses) ,
723720 ShapeType :: Circle => Circle :: update_shape ( document, input, layer, responses) ,
724721 ShapeType :: Arc => Arc :: update_shape ( document, input, layer, tool_data, modifier, responses) ,
722+ ShapeType :: Rectangle => Rectangle :: update_shape ( document, input, layer, tool_data, modifier, responses) ,
723+ ShapeType :: Ellipse => Ellipse :: update_shape ( document, input, layer, tool_data, modifier, responses) ,
724+ ShapeType :: Line => Line :: update_shape ( document, input, layer, tool_data, modifier, responses) ,
725725 }
726726
727727 // Auto-panning
@@ -959,7 +959,9 @@ impl Fsm for ShapeToolFsmState {
959959 ShapeType :: Circle => HintGroup ( vec ! [ ] ) ,
960960 } ;
961961
962- common_hint_group. push ( tool_hint_group) ;
962+ if !tool_hint_group. 0 . is_empty ( ) {
963+ common_hint_group. push ( tool_hint_group) ;
964+ }
963965
964966 if matches ! ( shape, ShapeType :: Polygon | ShapeType :: Star ) {
965967 common_hint_group. push ( HintGroup ( vec ! [ HintInfo :: multi_keys( [ [ Key :: BracketLeft ] , [ Key :: BracketRight ] ] , "Decrease/Increase Sides" ) ] ) ) ;
0 commit comments