@@ -51,7 +51,7 @@ struct CreateAndEditGeometriesView: View {
5151 ) ,
5252 let graphic = identifyResult. graphics. first,
5353 !model. isStarted else { return }
54- model. startEditing ( withGraphic : graphic)
54+ model. startEditing ( with : graphic)
5555 }
5656 }
5757 }
@@ -382,11 +382,11 @@ private class GeometryEditorModel: ObservableObject {
382382
383383 /// Updates the selected graphic with the current geometry.
384384 private func updateGraphic( ) {
385- defer { selectedGraphic = nil }
386385 guard let selectedGraphic else { return }
387386 selectedGraphic. geometry = geometryEditor. stop ( )
388387 isStarted = false
389388 selectedGraphic. isVisible = true
389+ self . selectedGraphic = nil
390390 }
391391
392392 /// Adds a new graphic for the current geometry to the graphics overlay.
@@ -453,7 +453,6 @@ private class GeometryEditorModel: ObservableObject {
453453 /// - tool: The tool to draw with.
454454 /// - geometryType: The type of geometry to draw.
455455 func startEditing( with tool: GeometryEditorTool , geometryType: Geometry . Type ) {
456- selectedGraphic = nil
457456 configureGeometryEditorTool ( tool, scaleMode: scaleMode)
458457 geometryEditor. tool = tool
459458 geometryEditor. start ( withType: geometryType)
@@ -462,8 +461,8 @@ private class GeometryEditorModel: ObservableObject {
462461
463462 /// Starts editing a given graphic with the geometry editor.
464463 /// - Parameter graphic: The graphic to edit.
465- func startEditing( withGraphic graphic: Graphic ) {
466- guard let geometry = graphic. geometry else { return }
464+ func startEditing( with graphic: Graphic ) {
465+ let geometry = graphic. geometry!
467466
468467 switch geometry {
469468 case is Point , is Multipoint :
0 commit comments