aboutsummaryrefslogtreecommitdiff
path: root/Map/Views/MapRender.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2023-05-07 15:22:54 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2023-05-07 15:22:54 +0200
commitfdb4633d3e9158e457d57e820df6e1efb4df39c2 (patch)
tree176cad99cb9befc0a65a7af02561019e811814de /Map/Views/MapRender.swift
parent75a0e4509a70055851b085f3f7293ae1cf48164c (diff)
Update to support notes + new style2.0.0
Diffstat (limited to 'Map/Views/MapRender.swift')
-rw-r--r--Map/Views/MapRender.swift66
1 files changed, 0 insertions, 66 deletions
diff --git a/Map/Views/MapRender.swift b/Map/Views/MapRender.swift
deleted file mode 100644
index aa97e22..0000000
--- a/Map/Views/MapRender.swift
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// ContentView.swift
-// Map
-//
-// Created by Ruben Beltran del Rio on 2/1/21.
-//
-
-import Combine
-import CoreData
-import CoreGraphics
-import SwiftUI
-
-struct MapRenderView: View {
-
- @Environment(\.colorScheme) var colorScheme
-
- @Binding var content: String
- @Binding var evolution: Stage
-
- @State var parsedMap: ParsedMap = ParsedMap.empty
-
- let mapSize = CGSize(width: 1300.0, height: 1000.0)
-
- let lineWidth = CGFloat(1.0)
- let vertexSize = CGSize(width: 25.0, height: 25.0)
- let padding = CGFloat(30.0)
-
- var body: some View {
- ZStack(alignment: .topLeading) {
-
- Path { path in
- path.addRect(
- CGRect(
- x: -padding, y: -padding, width: mapSize.width + padding * 2,
- height: mapSize.height + padding * 4))
- }.fill(MapColor.colorForScheme(colorScheme).background)
-
- MapStages(mapSize: mapSize, lineWidth: lineWidth, stages: parsedMap.stages)
- MapAxes(
- mapSize: mapSize, lineWidth: lineWidth, evolution: evolution, stages: parsedMap.stages)
- MapOpportunities(
- mapSize: mapSize, lineWidth: lineWidth, vertexSize: vertexSize,
- opportunities: parsedMap.opportunities)
- MapBlockers(mapSize: mapSize, vertexSize: vertexSize, blockers: parsedMap.blockers)
- MapVertices(mapSize: mapSize, vertexSize: vertexSize, vertices: parsedMap.vertices)
- MapEdges(
- mapSize: mapSize, lineWidth: lineWidth, vertexSize: vertexSize, edges: parsedMap.edges)
- }.frame(
- width: mapSize.width,
- height: mapSize.height + 2 * padding, alignment: .topLeading
- ).onAppear {
- self.parsedMap = Map.parse(content: content)
- }.padding(padding).onChange(of: content) { newState in
- self.parsedMap = Map.parse(content: newState)
- }
- }
-}
-
-struct MapRenderView_Previews: PreviewProvider {
- static var previews: some View {
- MapRenderView(
- content: Binding.constant(""), evolution: Binding.constant(Stage.stages(.general))
- ).environment(
- \.managedObjectContext, PersistenceController.preview.container.viewContext)
- }
-}