Skip to content
Permalink
Browse files

Removed unnecessary calls to update view

  • Loading branch information...
lcs-rgordon committed Jul 25, 2019
1 parent a5e5a23 commit ae8b55317e4b3a80c67f18f4d1b94640db93da17
Binary file not shown.
@@ -230,9 +230,7 @@ open class Canvas : NSImageView, CustomPlaygroundDisplayConvertible {
*/
open func drawText(message: String, at: Point, size: Int = 24, kerning : Float = 0.0) {

print("inside drawText")


// Set attributes of shape based on the canvas scale factor
var size = size
size *= scale
@@ -269,9 +267,6 @@ open class Canvas : NSImageView, CustomPlaygroundDisplayConvertible {
// Draw the string
string.draw(at: NSPoint(x: x, y: y), withAttributes: attributes)

// Make the view update
self.setNeedsDisplay()

}

/**
@@ -318,9 +313,6 @@ open class Canvas : NSImageView, CustomPlaygroundDisplayConvertible {
// Draw the line
path.stroke()

// Make the view update
self.setNeedsDisplay()

}

/**
@@ -372,9 +364,6 @@ open class Canvas : NSImageView, CustomPlaygroundDisplayConvertible {
path.fill()
}

// Make the view update
self.setNeedsDisplay()

}

/**
@@ -433,9 +422,6 @@ open class Canvas : NSImageView, CustomPlaygroundDisplayConvertible {
path.fill()
}

// Make the view update
self.setNeedsDisplay()

}

/**
@@ -520,9 +506,6 @@ open class Canvas : NSImageView, CustomPlaygroundDisplayConvertible {
path.fill()
}

// Make the view update
self.setNeedsDisplay()

}

/**
@@ -590,9 +573,6 @@ open class Canvas : NSImageView, CustomPlaygroundDisplayConvertible {
customPath.fill()
}

// Make the view update
self.setNeedsDisplay()

}

/**
@@ -611,9 +591,6 @@ open class Canvas : NSImageView, CustomPlaygroundDisplayConvertible {
xform.rotate(byDegrees: provided)
xform.concat()

// Make the view update
self.setNeedsDisplay()

}

/**
@@ -636,9 +613,6 @@ open class Canvas : NSImageView, CustomPlaygroundDisplayConvertible {
xform.translateX(by: byX, yBy: byY)
xform.concat()

// Make the view update
self.setNeedsDisplay()

}

/**
@@ -712,9 +686,6 @@ open class Canvas : NSImageView, CustomPlaygroundDisplayConvertible {
self.drawText(message: "x", at: Point(x: 50, y: 5))
self.drawText(message: "y", at: Point(x: 5, y: 50))

// Make the view update
self.setNeedsDisplay()

}

}

0 comments on commit ae8b553

Please sign in to comment.
You can’t perform that action at this time.