I’m trying to adjust a vector rectangle display object’s width and height in a touch function; however I’ve noticed that although the object increases as expected, it always does so from the centre of the object without regards to where I set the anchor point?
Is this intended functionality or perhaps something I’m doing wrong?
[lua]
local deltaX = startX - self.cursorImage.markX
local deltaY = startY - self.cursorImage.markY
print("deltaX: "…deltaX)
print("deltaY: "…deltaY)
if deltaX < 0 then
self.selectionArea.anchorX = 1
deltaX = deltaX * -1
else
self.selectionArea.anchorX = 0
end
if deltaY < 0 then
self.selectionArea.anchorY = 1
deltaY = deltaY * -1
else
self.selectionArea.anchorY = 0
end
self.selectionArea.width = math.round(deltaX/32)*32
self.selectionArea.height = math.round(deltaY/32)*32 --(
local path = self.selectionArea.path
print("path.height: "…path.height)
print("path.width: "…path.width)
[/lua]