HI folks, I just discovered that if you apply strokeWidth to a newRect, and then set the object’s width equal to its own width, it actually gets wider:
local square = display.newRect(0, 0, 50, 50)
print(square.width)
square.strokeWidth = 5
print(square.width)
square.width = square.width
print(square.width)
square.width = square.width
print(square.width)
square.width = square.width
print(square.width)
square.width = square.width
print(square.width)
--------------------------------------------------------
50
56
62
68
74
80
The increase in size is also greater than the strokeWidth. Is this behaviour a bug or is there a reason for it? It appears to me that for reading the width of the square, the stroke is included, but for setting the width, the value is interpreted as being for the “core”, so to speak, and then the stroke is added on after. Does other software follow this convention, or is it a solar thing?