summaryrefslogtreecommitdiff
path: root/assets/test/lasso
diff options
context:
space:
mode:
Diffstat (limited to 'assets/test/lasso')
-rw-r--r--assets/test/lasso/index.html14
1 files changed, 7 insertions, 7 deletions
diff --git a/assets/test/lasso/index.html b/assets/test/lasso/index.html
index f136f6d..62a9744 100644
--- a/assets/test/lasso/index.html
+++ b/assets/test/lasso/index.html
@@ -28,22 +28,22 @@ var mymouse = new mouse({
down: function(e, cursor){
// compare to initial point
if (placing) {
- if (points.length > 2 && points[0].distanceTo({ a: cursor.x.a, b: cursor.y.a }) < 3) {
+ if (points.length > 2 && points[0].distanceTo(cursor.a) < 3) {
points.push(points[0].clone())
placing = false
}
else {
- points.push( new point( cursor.x.a, cursor.y.a ) )
+ points.push( cursor.a )
}
}
else {
placing = true
points.length = 0
- points.push( new point( cursor.x.a, cursor.y.a ) )
+ points.push( cursor.a )
}
},
move: function(e, cursor){
- if (placing && points.length > 2 && points[0].distanceTo({ a: cursor.x.a, b: cursor.y.a }) < 3 ) {
+ if (placing && points.length > 2 && points[0].distanceTo(cursor.a) < 3 ) {
document.body.style.cursor = "pointer"
}
else {
@@ -62,15 +62,15 @@ function draw (time) {
if (points.length == 1) {
ctx.fillStyle = "#000"
- ctx.fillRect(points[0].a, points[0].b, 1, 1)
+ ctx.fillRect(points[0].x, points[0].y, 1, 1)
}
if (points.length > 1) {
ctx.fillStyle = "#000"
ctx.strokeStyle = "#000"
ctx.beginPath()
- ctx.moveTo(points[0].a, points[0].b)
+ ctx.moveTo(points[0].x, points[0].y)
points.forEach(function(point, i){
- i && ctx.lineTo(point.a, point.b)
+ i && ctx.lineTo(point.x, point.y)
})
if (placing) {
ctx.stroke()