File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -372,12 +372,10 @@ public class QuartzRenderer: Renderer {
372372 public func drawSolidPolygon( polygon: SwiftPlot . Polygon ,
373373 fillColor: Color ) {
374374 let polygonPath = CGMutablePath ( )
375- var points = polygon. makeIterator ( )
376- let p1 = points. next ( ) !
377- polygonPath. move ( to: CGPoint ( x: Double ( p1. x + xOffset) , y: Double ( p1. y + yOffset) ) )
378- for point in points {
379- polygonPath. addLine ( to: CGPoint ( x: Double ( point. x + xOffset) , y: Double ( point. y + yOffset) ) )
380- }
375+ polygonPath. move ( to: CGPoint ( x: Double ( polygon. p1. x + xOffset) , y: Double ( polygon. p1. y + yOffset) ) )
376+ polygonPath. addLine ( to: CGPoint ( x: Double ( polygon. p2. x + xOffset) , y: Double ( polygon. p2. y + yOffset) ) )
377+ polygonPath. addLine ( to: CGPoint ( x: Double ( polygon. p3. x + xOffset) , y: Double ( polygon. p3. y + yOffset) ) )
378+ polygon. tail. forEach { polygonPath. addLine ( to: CGPoint ( x: Double ( $0. x + xOffset) , y: Double ( $0. y + yOffset) ) ) }
381379 polygonPath. closeSubpath ( )
382380 context. setFillColor ( fillColor. cgColor)
383381 context. addPath ( polygonPath)
You can’t perform that action at this time.
0 commit comments