`affineTransform:transformedAABB` seems to only apply translation? What about scale?

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.

Looking at the code I can see that it was done intentionally (by me! Hmm!), but I do not remember if there was a specific reason for that.

I think it makes sense that scaling should be possible as well, so I'll file a bug on this!

(Sheering I don't think would make sense because then the result would no longer be an axis-aligned rectangle, right?)

1 Like

Yeah, that makes sense to me.
Thanks for looking into this!