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:

Layer.background.bezierPath.setLineWidth_(2.0)
Layer.background.bezierPath.stroke()

Alternatively, you can set the defaultLineWidth:

NSBezierPath.setDefaultLineWidth_(3.0)

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))
myPath.setLineWidth_(strokeWidth)
myPath.stroke()

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
myPath.setLineWidth_(strokeWidth)
myPath.stroke()