console.log(rightPoint, leftPoint)
console.log(rightPoint - leftPoint)
->
Point: {x:0, y:0}, Point:{x:10, y:10}
NaN
Shouldnt this work..?
Where are you executing this code? The Math operator overloading will only work if it's in a PaperScript context. If not, you'll need to use:
rightPoint.subtract(leftPoint)
ah ok
it is outside of the paperscript
so im doing this :
var rightPoint = new paper.Point(x,y);
(haven't got code to hand, but something like that is what im doing lol)
I shall do your suggestion this eve cheers !
Most helpful comment
Where are you executing this code? The Math operator overloading will only work if it's in a PaperScript context. If not, you'll need to use:
rightPoint.subtract(leftPoint)