Set stroke width when drawing in reporter with stroke() method

For example with Layer.background.bezierPath.stroke() ?

Take a peek into the NSBezierPath class reference: a bezierPath has a lineWidth attribute. Therefore:


Alternatively, you can set the defaultLineWidth:


When you change something on the bezierpath of the layer, it is better to copy it first. Setting the line width is fine but anything else like transforming it is not.
And using default line width is probably not a good idea. It only works with new paths and might disturb drawing later on in the app if someone is assuming it to be at the default.

I see, I’ve seen it applied like such

strokeWidth = 1/self.getScale()
myPath = NSBezierPath.bezierPath()
myPath.moveToPoint_((x1, y1))
myPath.lineToPoint_((x2, y2))

but wasn’t sure how to do it when it’s not assigned to referencable variable, would it work like this for the above:

strokeWidth = 1/self.getScale()
myPath = Layer.background.bezierPath