Geometry.point:offset floors its arguments

Try the following:

local pointA = playdate.geometry.point.new(1.4, 1.4)
pointA:offset(1.6, 1.6)
print(pointA)

The expectation is that pointA will be (3.0, 3.0) after the offset call.
The actual result is that pointA is (2.4, 2.4) after the offset call.

The arguments to offset seems to be floored before being applied.

Note: this behavior also applies to geometry.point:offsetBy.

On the other hand, adding a vector to the point seems to work as expected- the vector values are not floored.

This is on macOS, simulator version 1.9.0

Ah, good catch! I'm guessing we pass floats to int arguments without rounding. Filed, will fix soon!

1 Like