Using the Lua API with SDK v2.0.1 on macOS, I'm trying to transform a rect using an affineTransform, but scaling (or shear for that matter, but I don't need shear) doesn't seem to affect the size of the rect. Only the translation is applied. Am I misunderstanding something about this API, or is this a bug? Any way to do what I'm wanting?
local xForm = geo.affineTransform.new(1.75, 0, 0, 1.75, 10, 10) local rect = geo.rect.new(0, 0, 100, 100) local xFormedRect = xForm:transformedAABB(rect) print("transformedRect:", xFormedRect:unpack()) -- Prints "transformedRect: 10.0 10.0 100.0 100.0" but it should be 10.0 10.0 175.0 175.0
Edit: I've worked around this for now by creating line segments from the with and height of the rect and using
xForm:transformedLineSegment() (which does seem to account for scale at least), and then using the resulting lengths to recreate the correct rect.
Still curious though if it's a bug or if my assumptions are off about how it's supposed to work.