diff options
Diffstat (limited to 'Map/Presentation/MapEditor.swift')
| -rw-r--r-- | Map/Presentation/MapEditor.swift | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Map/Presentation/MapEditor.swift b/Map/Presentation/MapEditor.swift index c8ce5cd..f9a8dae 100644 --- a/Map/Presentation/MapEditor.swift +++ b/Map/Presentation/MapEditor.swift @@ -19,7 +19,7 @@ struct MapEditor: View { var url: URL? @State var selectedEvolution: StageType = .behavior @State var isSearching: Bool = false - var parsedMap: [Wmap.Entity] { + var parsedMap: Wmap.ParsedMap { document.parsed } @@ -34,6 +34,11 @@ struct MapEditor: View { @AppStorage("editorFontSize") var editorFontSize: Double = UserPreferences.Defaults.editorFontSize @AppStorage("softWrapLines") var softWrapLines: Bool = UserPreferences.Defaults .softWrapLines + @AppStorage("useSmartEditor") var useSmartEditor: Bool = UserPreferences.Defaults + .useSmartEditor + @AppStorage("highlightMissingComponents") var highlightMissingComponents: Bool = UserPreferences + .Defaults + .highlightMissingComponents let zoomRange = Constants.kMinZoom...Constants.kMaxZoom @AppStorage("zoom") var zoom = UserPreferences.Defaults.zoom @@ -112,7 +117,9 @@ struct MapEditor: View { highlightRanges: results, selectedRange: selectedTerm ) - .id("\(useCustomEditorFont)-\(customEditorFontName)-\(editorFontSize)-\(softWrapLines)") + .id( + "\(useCustomEditorFont)-\(customEditorFontName)-\(editorFontSize)-\(softWrapLines)-\(useSmartEditor)-\(highlightMissingComponents)" + ) .background(Color.Theme.UI.background) .foregroundColor(Color.Theme.UI.foreground) .frame(minHeight: 96.0) @@ -122,7 +129,8 @@ struct MapEditor: View { GeometryReader { geometry in ScrollView([.horizontal, .vertical], showsIndicators: false) { MapRenderView( - entities: parsedMap, evolution: $selectedEvolution, onDragVertex: onDragVertex + entities: parsedMap.entities, evolution: $selectedEvolution, + onDragVertex: onDragVertex ) .scaleEffect(zoom, anchor: .center).frame( width: (Dimensions.Map.size.width + 2 * Dimensions.Map.padding) * zoom, |