diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-07 13:09:13 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-07 13:09:13 +0200 |
| commit | 3fdaeab6a7fa19b0c5424de487efc37c0994c86e (patch) | |
| tree | 09af4c1d54924350b4e6c89fb4f284170e89b945 /Map/Presentation/Complex Components/MapRender/MapRenderView.swift | |
| parent | 933078c10e99002c8a5f647e476819f0f1706a14 (diff) | |
More localization and map preferences
Diffstat (limited to 'Map/Presentation/Complex Components/MapRender/MapRenderView.swift')
| -rw-r--r-- | Map/Presentation/Complex Components/MapRender/MapRenderView.swift | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/Map/Presentation/Complex Components/MapRender/MapRenderView.swift b/Map/Presentation/Complex Components/MapRender/MapRenderView.swift index 780290b..2357013 100644 --- a/Map/Presentation/Complex Components/MapRender/MapRenderView.swift +++ b/Map/Presentation/Complex Components/MapRender/MapRenderView.swift @@ -21,6 +21,7 @@ struct MapRenderView: View { @Binding var document: MapDocument @Binding var evolution: StageType + @AppStorage("showMapBackground") var showMapBackground: Bool = true var stage: Stage { Stage.stages(evolution) @@ -47,25 +48,36 @@ struct MapRenderView: View { x: -padding, y: -padding, width: mapSize.width + padding * 2, height: mapSize.height + padding * 4)) }.fill(.white) + + // The order Matters. Think of this as layers. - MapStages(mapSize: mapSize, lineWidth: lineWidth, stages: parsedMap.stages) + if showMapBackground { + MapBackground(mapSize: mapSize, lineWidth: lineWidth, stages: parsedMap.stages) + } MapAxes( mapSize: mapSize, lineWidth: lineWidth, evolution: stage, stages: parsedMap.stages) - MapEdges( - mapSize: mapSize, lineWidth: lineWidth, vertexSize: vertexSize, edges: parsedMap.edges) - MapBlockers(mapSize: mapSize, vertexSize: vertexSize, blockers: parsedMap.blockers) - MapVertices( - mapSize: mapSize, vertexSize: vertexSize, vertices: parsedMap.vertices, - onDragVertex: onDragVertex) - MapOpportunities( - mapSize: mapSize, lineWidth: lineWidth, vertexSize: vertexSize, - opportunities: parsedMap.opportunities) + Group { + MapStages(mapSize: mapSize, lineWidth: lineWidth, stages: parsedMap.stages) + MapEdges( + mapSize: mapSize, lineWidth: lineWidth, vertexSize: vertexSize, edges: parsedMap.edges) + MapOpportunities( + mapSize: mapSize, lineWidth: lineWidth, vertexSize: vertexSize, + opportunities: parsedMap.opportunities) + MapBlockers(mapSize: mapSize, vertexSize: vertexSize, blockers: parsedMap.blockers) + }.mask { + MapMask( + mapSize: mapSize, vertexSize: vertexSize, vertices: parsedMap.vertices) + } + MapVertices( + mapSize: mapSize, vertexSize: vertexSize, vertices: parsedMap.vertices, + onDragVertex: onDragVertex) MapGroups(mapSize: mapSize, vertexSize: vertexSize, groups: parsedMap.groups).drawingGroup( opaque: true ).opacity(0.1) MapNotes( mapSize: mapSize, lineWidth: lineWidth, notes: parsedMap.notes) - }.offset(x: padding, y: padding).frame( + } + .offset(x: padding, y: padding).frame( width: mapSize.width + 2 * padding, height: mapSize.height + 2 * padding, alignment: .topLeading ) |