Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Source/CoreGraphicsPolyfill.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
private let KAPPA: CGFloat = 0.5522847498 // 4 *(sqrt(2) -1)/3

public struct CGAffineTransform: Equatable {
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Images/SVGDataImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
// Created by Alisa Mylnikova on 10/06/2021.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
import Combine
#endif

public class SVGDataImage: SVGImage {
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var data: Data
#else
@Published public var data: Data
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Images/SVGURLImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Alisa Mylnikova on 22/09/2021.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Nodes/SVGDefs.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Nodes/SVGGroup.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
import Combine
#endif

public class SVGGroup: SVGNode {
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var contents: [SVGNode] = []
#else
@Published public var contents: [SVGNode] = []
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Nodes/SVGImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Alisa Mylnikova on 03/06/2021.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand All @@ -14,7 +14,7 @@ import Combine

public class SVGImage: SVGNode {

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var x: CGFloat
public var y: CGFloat
public var width: CGFloat
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Nodes/SVGMarker.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down Expand Up @@ -60,7 +60,7 @@ public class SVGMarker: SVGGroup {
case strokeWidth
}

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var markerHeight: SVGLength
public var markerUnits: MarkerUnits
public var markerWidth: SVGLength
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Nodes/SVGNode.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand All @@ -7,7 +7,7 @@ import Combine

public class SVGNode: SerializableElement {

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var transform: CGAffineTransform = CGAffineTransform.identity
public var opaque: Bool
public var opacity: Double
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Nodes/SVGShape.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand All @@ -7,7 +7,7 @@ import Combine

public class SVGShape: SVGNode {

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var fill: SVGPaint?
public var stroke: SVGStroke?
#else
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Nodes/SVGText.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand All @@ -12,7 +12,7 @@ public class SVGText: SVGNode {
case trailing
}

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var text: String
public var font: SVGFont?
public var fill: SVGPaint?
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Nodes/SVGUserSpaceNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Alisa Mylnikova on 14/10/2020.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Nodes/SVGViewport.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
import Combine
#endif

public class SVGViewport: SVGGroup {
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var width: SVGLength
public var height: SVGLength
public var viewBox: CGRect?
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Primitives/SVGColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Yuriy Strot on 19.01.2021.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Primitives/SVGFont.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Primitives/SVGGradient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Yuriy Strot on 22.02.2021.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Primitives/SVGLength.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Alisa Mylnikova on 13/10/2020.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Primitives/SVGPaint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Yuriy Strot on 19.01.2021.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Primitives/SVGPreserveAspectRatio.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Yuriy Strot on 20.01.2021.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Primitives/SVGStroke.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Shapes/SVGCircle.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand All @@ -7,7 +7,7 @@ import Combine

public class SVGCircle: SVGShape {

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var cx: CGFloat
public var cy: CGFloat
public var r: CGFloat
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Shapes/SVGEllipse.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
import Combine
#endif

public class SVGEllipse: SVGShape {
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var cx: CGFloat
public var cy: CGFloat
public var rx: CGFloat
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Shapes/SVGLine.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand All @@ -7,7 +7,7 @@ import Combine

public class SVGLine: SVGShape {

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var x1: CGFloat
public var y1: CGFloat
public var x2: CGFloat
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Shapes/SVGPath.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand All @@ -7,7 +7,7 @@ import Combine

public class SVGPath: SVGShape {

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var segments: [PathSegment]
public var fillRule: CGPathFillRule
#else
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Shapes/SVGPolygon.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand All @@ -7,7 +7,7 @@ import Combine

public class SVGPolygon: SVGShape {

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var points: [CGPoint]
#else
@Published public var points: [CGPoint]
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Shapes/SVGPolyline.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
import Combine
#endif

public class SVGPolyline: SVGShape {
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var points: [CGPoint]
#else
@Published public var points: [CGPoint]
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Shapes/SVGRect.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand All @@ -7,7 +7,7 @@ import Combine

public class SVGRect: SVGShape {

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
public var x: CGFloat
public var y: CGFloat
public var width: CGFloat
Expand Down
2 changes: 1 addition & 1 deletion Source/Parser/SVG/Elements/SVGImageParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Yuri Strot on 29.05.2022.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Parser/SVG/Elements/SVGTextParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Yuri Strot on 29.05.2022.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Parser/SVG/SVGIndex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Yuriy Strot on 21.02.2021.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Parser/SVG/SVGParserBasics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Alisa Mylnikova on 17/07/2020.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
2 changes: 1 addition & 1 deletion Source/Parser/SVG/SVGParserPrimitives.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Alisa Mylnikova on 20/07/2020.
//

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
import Foundation
#else
import SwiftUI
Expand Down
6 changes: 3 additions & 3 deletions Source/Parser/SVG/SVGPathReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public typealias MBezierPath = NSBezierPath
#elseif os(iOS) || os(tvOS) || os(watchOS)
import UIKit
public typealias MBezierPath = UIBezierPath
#elseif os(WASI) || os(Linux)
#elseif os(WASI) || os(Linux) || os(Android)
import Foundation
#endif

Expand Down Expand Up @@ -336,7 +336,7 @@ extension SVGPath {
return CGFloat > 0.5 ? true : false
}

#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
var bezierPath = MBezierPath()
#else
let bezierPath = MBezierPath()
Expand Down Expand Up @@ -565,7 +565,7 @@ extension SVGPath {
bezierPath.addArc(withCenter: CGPoint(x: cx, y: cy), radius: CGFloat(w / 2), startAngle: extent, endAngle: end, clockwise: arcAngle >= 0)
} else {
let maxSize = CGFloat(max(w, h))
#if os(WASI) || os(Linux)
#if os(WASI) || os(Linux) || os(Android)
var path = MBezierPath(arcCenter: CGPoint.zero, radius: maxSize / 2, startAngle: extent, endAngle: end, clockwise: arcAngle >= 0)
#else
let path = MBezierPath(arcCenter: CGPoint.zero, radius: maxSize / 2, startAngle: extent, endAngle: end, clockwise: arcAngle >= 0)
Expand Down
Loading
Loading