@@ -27,16 +27,6 @@ extension SnapGeometryEditsView {
2727 /// The current geometry of the geometry editor.
2828 @State private var geometry : Geometry ?
2929
30- /// The geometry editor tool used to edit geometries for the most optimal
31- /// snapping experience based on the device type.
32- private var adaptiveVertexTool : GeometryEditorTool {
33- #if targetEnvironment(macCatalyst)
34- VertexTool ( )
35- #else
36- ReticleVertexTool ( )
37- #endif
38- }
39-
4030 /// A Boolean value indicating if the geometry editor can perform an undo.
4131 private var canUndo : Bool {
4232 return model. geometryEditor. canUndo
@@ -96,61 +86,19 @@ extension SnapGeometryEditsView {
9686 private var mainMenuContent : some View {
9787 VStack {
9888 Button ( " New Point " , systemImage: " smallcircle.filled.circle " ) {
99- model. startEditing ( with : adaptiveVertexTool , geometryType : Point . self)
89+ model. startEditing ( withType : Point . self)
10090 }
10191
10292 Button ( " New Line " , systemImage: " line.diagonal " ) {
103- model. startEditing ( with : adaptiveVertexTool , geometryType : Polyline . self)
93+ model. startEditing ( withType : Polyline . self)
10494 }
10595
10696 Button ( " New Area " , systemImage: " skew " ) {
107- model. startEditing ( with : adaptiveVertexTool , geometryType : Polygon . self)
97+ model. startEditing ( withType : Polygon . self)
10898 }
10999
110100 Button ( " New Multipoint " , systemImage: " hand.point.up.braille " ) {
111- model. startEditing ( with: adaptiveVertexTool, geometryType: Multipoint . self)
112- }
113-
114- Button ( " New Freehand Line " , systemImage: " scribble " ) {
115- model. startEditing ( with: FreehandTool ( ) , geometryType: Polyline . self)
116- }
117-
118- Button ( " New Freehand Area " , systemImage: " lasso " ) {
119- model. startEditing ( with: FreehandTool ( ) , geometryType: Polygon . self)
120- }
121-
122- Menu ( " Shapes " ) {
123- Button ( " New Line Arrow " , systemImage: " arrowshape.right " ) {
124- model. startEditing ( with: ShapeTool ( kind: . arrow) , geometryType: Polyline . self)
125- }
126-
127- Button ( " New Polygon Arrow " , systemImage: " arrowshape.right.fill " ) {
128- model. startEditing ( with: ShapeTool ( kind: . arrow) , geometryType: Polygon . self)
129- }
130-
131- Button ( " New Line Rectangle " , systemImage: " rectangle " ) {
132- model. startEditing ( with: ShapeTool ( kind: . rectangle) , geometryType: Polyline . self)
133- }
134-
135- Button ( " New Polygon Rectangle " , systemImage: " rectangle.fill " ) {
136- model. startEditing ( with: ShapeTool ( kind: . rectangle) , geometryType: Polygon . self)
137- }
138-
139- Button ( " New Line Ellipse " , systemImage: " circle " ) {
140- model. startEditing ( with: ShapeTool ( kind: . ellipse) , geometryType: Polyline . self)
141- }
142-
143- Button ( " New Polygon Ellipse " , systemImage: " circle.fill " ) {
144- model. startEditing ( with: ShapeTool ( kind: . ellipse) , geometryType: Polygon . self)
145- }
146-
147- Button ( " New Line Triangle " , systemImage: " triangle " ) {
148- model. startEditing ( with: ShapeTool ( kind: . triangle) , geometryType: Polyline . self)
149- }
150-
151- Button ( " New Polygon Triangle " , systemImage: " triangle.fill " ) {
152- model. startEditing ( with: ShapeTool ( kind: . triangle) , geometryType: Polygon . self)
153- }
101+ model. startEditing ( withType: Multipoint . self)
154102 }
155103
156104 Divider ( )
@@ -180,7 +128,9 @@ extension SnapGeometryEditsView {
180128 }
181129 . disabled ( deleteButtonIsDisabled)
182130
183- Toggle ( " Uniform Scale " , isOn: $model. isUniformScale)
131+ if model. adaptiveVertexTool is VertexTool {
132+ Toggle ( " Uniform Scale " , isOn: $model. isUniformScale)
133+ }
184134
185135 Button ( " Clear Current Sketch " , systemImage: " trash " , role: . destructive) {
186136 model. geometryEditor. clearGeometry ( )
0 commit comments