From d91e67e06095afbdbe47353eb71d2829a9a9c401 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 1 May 2012 14:52:12 -0700 Subject: handle left button up correctly for the brush tool --- js/tools/BrushTool.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index ded56ecc..1666d311 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js @@ -225,9 +225,11 @@ exports.BrushTool = Montage.create(ShapeTool, { this._hasDraw = false; //finish giving enough info. to the brush stroke - this._selectedBrushStroke.setPlaneMatrix(this._brushStrokePlaneMat); - this._selectedBrushStroke.setPlaneMatrixInverse(glmat4.inverse(this._brushStrokePlaneMat,[])); - this._selectedBrushStroke.setDragPlane(this._draggingPlane); + if (this._selectedBrushStroke){ + this._selectedBrushStroke.setPlaneMatrix(this._brushStrokePlaneMat); + this._selectedBrushStroke.setPlaneMatrixInverse(glmat4.inverse(this._brushStrokePlaneMat,[])); + this._selectedBrushStroke.setDragPlane(this._draggingPlane); + } //display the previously drawn stroke in a separate canvas this.RenderCurrentBrushStroke(); -- cgit v1.2.3