Copy paste this code into main and run it. Then try commenting out the print statement and run again and notice how the square changes position.
[lua]-- Create guides for clarity
local line = display.newLine(0, 300, display.contentWidth, 300)
local line2 = display.newLine(100, 0, 100, display.contentHeight)
local group = display.newGroup()
local group2 = display.newGroup()
group.y = 300
group : insert(group2)
local square = display.newRect(0,0, 28, 28)
square : rotate(-90) – If commented out behaviour is different
group2 : insert(square)
– Comment this print statement out and square position is affected
print(group2.height)
square : setReferencePoint(display.CenterLeftReferencePoint)
square.x = 100[/lua]
The square:rotate function also changes the behaviour.