From fd8126510d15d1c38f0e0354c40c5525f6980349 Mon Sep 17 00:00:00 2001 From: Eric Levin Date: Thu, 4 Jun 2015 21:41:19 -0700 Subject: [PATCH] marker ball now stays without mouse whether or not user is drawing --- examples/paint.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/paint.js b/examples/paint.js index 787e9156bc..837b217797 100644 --- a/examples/paint.js +++ b/examples/paint.js @@ -131,21 +131,22 @@ function MousePaint() { function mouseMoveEvent(event) { - if (!isDrawing) { - return; - } var pickRay = Camera.computePickRay(event.x, event.y); var addVector = Vec3.multiply(Vec3.normalize(pickRay.direction), DRAWING_DISTANCE); var point = Vec3.sum(Camera.getPosition(), addVector); - points.push(point); Entities.editEntity(line, { linePoints: points }); Entities.editEntity(brush, { position: point }); + if (!isDrawing) { + return; + } + + points.push(point); path.push(point); if (points.length === MAX_POINTS_PER_LINE) { @@ -168,6 +169,10 @@ function MousePaint() { } function mousePressEvent(event) { + if(!event.isLeftButton) { + isDrawing = false; + return; + } lineRider.mousePressEvent(event); path = []; newLine();