mirror of
https://github.com/exyte/Macaw.git
synced 2024-09-11 05:05:23 +03:00
Override toPath() for Line.
This commit is contained in:
parent
90e8c66ced
commit
78fb030e12
@ -19,4 +19,8 @@ open class Line: Locus {
|
||||
w: abs(x1 - x2),
|
||||
h: abs(y1 - y2))
|
||||
}
|
||||
|
||||
override open func toPath() -> Path {
|
||||
return MoveTo(x: x1, y: y1).lineTo(x: x2, y: y2).build()
|
||||
}
|
||||
}
|
||||
|
@ -20,9 +20,7 @@ open class Locus {
|
||||
}
|
||||
|
||||
open func toPath() -> Path {
|
||||
if let line = self as? Line {
|
||||
return MoveTo(x: line.x1, y: line.y1).lineTo(x: line.x2, y: line.y2).build()
|
||||
} else if let polygon = self as? Polygon {
|
||||
if let polygon = self as? Polygon {
|
||||
return pointsToPath(polygon.points, close: true)
|
||||
} else if let polyline = self as? Polyline {
|
||||
return pointsToPath(polyline.points)
|
||||
|
Loading…
Reference in New Issue
Block a user