Remove control statements brackets

This commit is contained in:
Anton Marunko
2017-11-30 15:43:55 +07:00
parent 6eaf65e5ef
commit 072929a4b5
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ extension Locus {
let cy = arc.ellipse.cy
var delta = arc.extent
if (arc.shift == 0.0 && abs(arc.extent - .pi * 2.0) < 0.00001) {
if arc.shift == 0.0 && abs(arc.extent - .pi * 2.0) < 0.00001 {
delta = .pi * 2.0 - 0.001
}
let theta1 = arc.shift
@@ -42,7 +42,7 @@ extension Locus {
fileprivate func pointsToPath(_ points: [Double], close: Bool = false) -> Path {
var pb = PathBuilder(segment: PathSegment(type: .M, data: [points[0], points[1]]))
if (points.count > 2) {
if points.count > 2 {
let parts = stride(from: 2, to: points.count, by: 2).map { Array(points[$0 ..< $0 + 2]) }
for part in parts {
pb = pb.lineTo(x: part[0], y: part[1])
+1 -1
View File
@@ -49,7 +49,7 @@ class ShapeRenderer: NodeRenderer {
var drawingMode: CGPathDrawingMode? = nil
if let stroke = shape.stroke {
setStrokeAttributes(stroke, ctx: ctx)
if (shape.fill != nil) {
if shape.fill != nil {
drawingMode = .fillStroke
} else {
drawingMode = .stroke