One would expect p to be Pt(2, 2), but it's actually Pt(1, 1).
I suspect that this is because unlike the top left point, the bottom right point is not initialized using the setter, but uses an direct assignment to the member variable, so it's not one of the points that are indexable using numbers (setters make the points indexable from 0 and 1). Methods such as add are inherited from Group, and they rely on integer indexing to get points.
I'm using 0.11.3, but this appears to also exist in master.
One would expect
p
to bePt(2, 2)
, but it's actuallyPt(1, 1)
.I suspect that this is because unlike the top left point, the bottom right point is not initialized using the setter, but uses an direct assignment to the member variable, so it's not one of the points that are indexable using numbers (setters make the points indexable from 0 and 1). Methods such as
add
are inherited fromGroup
, and they rely on integer indexing to get points.I'm using 0.11.3, but this appears to also exist in master.
https://github.com/williamngan/pts/blob/47de4b76ce6a24892c2c7e2b155c09a18e1d5b7e/src/Pt.ts#L1021-L1022
For anyone else who is facing this issue and don't want to wait for a fix to land, there's an
update
method onBound
that updates the point.