Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Sources/VectorPlus/SwiftUI/SVGView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import Swift2D
import SwiftSVG
import SwiftUI

struct SVGView: View {
public struct SVGView: View {
let svg: SVG
private var paths: [SwiftSVG.Path] { svg.paths ?? [] }
private var content: [(Int, SwiftSVG.Path)] { Array(zip(paths.indices, paths)) }

var body: some View {
public init(svg: SVG) {
self.svg = svg
}

public var body: some View {
GeometryReader { geometry in
ZStack {
ForEach(content, id: \.0) { index, path in
Expand Down
Loading