@@ -4,6 +4,7 @@ use crate::messages::portfolio::document::utility_types::document_metadata::Laye
44use crate :: messages:: prelude:: { DocumentMessageHandler , InputPreprocessorMessageHandler } ;
55use crate :: messages:: tool:: common_functionality:: graph_modification_utils;
66use crate :: messages:: tool:: common_functionality:: shape_editor:: ShapeState ;
7+ use crate :: messages:: tool:: common_functionality:: shapes:: arc_shape:: ArcGizmoHandler ;
78use crate :: messages:: tool:: common_functionality:: shapes:: polygon_shape:: PolygonGizmoHandler ;
89use crate :: messages:: tool:: common_functionality:: shapes:: shape_utility:: ShapeGizmoHandler ;
910use crate :: messages:: tool:: common_functionality:: shapes:: star_shape:: StarGizmoHandler ;
@@ -23,6 +24,7 @@ pub enum ShapeGizmoHandlers {
2324 None ,
2425 Star ( StarGizmoHandler ) ,
2526 Polygon ( PolygonGizmoHandler ) ,
27+ Arc ( ArcGizmoHandler ) ,
2628}
2729
2830impl ShapeGizmoHandlers {
@@ -32,6 +34,7 @@ impl ShapeGizmoHandlers {
3234 match self {
3335 Self :: Star ( _) => "star" ,
3436 Self :: Polygon ( _) => "polygon" ,
37+ Self :: Arc ( _) => "arc" ,
3538 Self :: None => "none" ,
3639 }
3740 }
@@ -41,6 +44,7 @@ impl ShapeGizmoHandlers {
4144 match self {
4245 Self :: Star ( h) => h. handle_state ( layer, mouse_position, document, responses) ,
4346 Self :: Polygon ( h) => h. handle_state ( layer, mouse_position, document, responses) ,
47+ Self :: Arc ( h) => h. handle_state ( layer, mouse_position, document, responses) ,
4448 Self :: None => { }
4549 }
4650 }
@@ -50,6 +54,7 @@ impl ShapeGizmoHandlers {
5054 match self {
5155 Self :: Star ( h) => h. is_any_gizmo_hovered ( ) ,
5256 Self :: Polygon ( h) => h. is_any_gizmo_hovered ( ) ,
57+ Self :: Arc ( h) => h. is_any_gizmo_hovered ( ) ,
5358 Self :: None => false ,
5459 }
5560 }
@@ -59,6 +64,7 @@ impl ShapeGizmoHandlers {
5964 match self {
6065 Self :: Star ( h) => h. handle_click ( ) ,
6166 Self :: Polygon ( h) => h. handle_click ( ) ,
67+ Self :: Arc ( h) => h. handle_click ( ) ,
6268 Self :: None => { }
6369 }
6470 }
@@ -68,6 +74,7 @@ impl ShapeGizmoHandlers {
6874 match self {
6975 Self :: Star ( h) => h. handle_update ( drag_start, document, input, responses) ,
7076 Self :: Polygon ( h) => h. handle_update ( drag_start, document, input, responses) ,
77+ Self :: Arc ( h) => h. handle_update ( drag_start, document, input, responses) ,
7178 Self :: None => { }
7279 }
7380 }
@@ -77,6 +84,7 @@ impl ShapeGizmoHandlers {
7784 match self {
7885 Self :: Star ( h) => h. cleanup ( ) ,
7986 Self :: Polygon ( h) => h. cleanup ( ) ,
87+ Self :: Arc ( h) => h. cleanup ( ) ,
8088 Self :: None => { }
8189 }
8290 }
@@ -94,6 +102,7 @@ impl ShapeGizmoHandlers {
94102 match self {
95103 Self :: Star ( h) => h. overlays ( document, layer, input, shape_editor, mouse_position, overlay_context) ,
96104 Self :: Polygon ( h) => h. overlays ( document, layer, input, shape_editor, mouse_position, overlay_context) ,
105+ Self :: Arc ( h) => h. overlays ( document, layer, input, shape_editor, mouse_position, overlay_context) ,
97106 Self :: None => { }
98107 }
99108 }
@@ -110,6 +119,7 @@ impl ShapeGizmoHandlers {
110119 match self {
111120 Self :: Star ( h) => h. dragging_overlays ( document, input, shape_editor, mouse_position, overlay_context) ,
112121 Self :: Polygon ( h) => h. dragging_overlays ( document, input, shape_editor, mouse_position, overlay_context) ,
122+ Self :: Arc ( h) => h. dragging_overlays ( document, input, shape_editor, mouse_position, overlay_context) ,
113123 Self :: None => { }
114124 }
115125 }
@@ -141,11 +151,14 @@ impl GizmoManager {
141151 if graph_modification_utils:: get_star_id ( layer, & document. network_interface ) . is_some ( ) {
142152 return Some ( ShapeGizmoHandlers :: Star ( StarGizmoHandler :: default ( ) ) ) ;
143153 }
144-
145154 // Polygon
146155 if graph_modification_utils:: get_polygon_id ( layer, & document. network_interface ) . is_some ( ) {
147156 return Some ( ShapeGizmoHandlers :: Polygon ( PolygonGizmoHandler :: default ( ) ) ) ;
148157 }
158+ // Arc
159+ if graph_modification_utils:: get_arc_id ( layer, & document. network_interface ) . is_some ( ) {
160+ return Some ( ShapeGizmoHandlers :: Arc ( ArcGizmoHandler :: new ( ) ) ) ;
161+ }
149162
150163 None
151164 }
0 commit comments