diff options
author | Valerio Virgillito | 2012-06-06 14:37:04 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-06-06 14:37:04 -0700 |
commit | bc7ca741f8c8adcb5c5919af6f808a20c37ea5d7 (patch) | |
tree | 0e4cf90f47937e7d718d82da1a0d0dab5ac5f136 /js/tools/BrushTool.js | |
parent | fb684fb27c2cef04251655d86e55eceed9da3132 (diff) | |
parent | e14ce28b5c8858af75fbf2003c8f1b854daa7e35 (diff) | |
download | ninja-bc7ca741f8c8adcb5c5919af6f808a20c37ea5d7.tar.gz |
Merge branch 'refs/heads/master' into element-model-fixes
Conflicts:
js/document/models/html.js
js/document/views/design.js
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/tools/BrushTool.js')
-rw-r--r-- | js/tools/BrushTool.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index f7c8ea1e..a360833a 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js | |||
@@ -39,7 +39,7 @@ exports.BrushTool = Montage.create(ShapeTool, { | |||
39 | //view options | 39 | //view options |
40 | _brushStrokeCanvas: {value: null, writable: true}, | 40 | _brushStrokeCanvas: {value: null, writable: true}, |
41 | _brushStrokePlaneMat: {value: null, writable: true}, | 41 | _brushStrokePlaneMat: {value: null, writable: true}, |
42 | _draggingPlane: {value: null, writable: true}, | 42 | dragPlane: {value: null, writable: true}, |
43 | 43 | ||
44 | //the current brush stroke | 44 | //the current brush stroke |
45 | _selectedBrushStroke: {value: null, writable: true}, | 45 | _selectedBrushStroke: {value: null, writable: true}, |
@@ -67,7 +67,7 @@ exports.BrushTool = Montage.create(ShapeTool, { | |||
67 | 67 | ||
68 | var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(x,y)); | 68 | var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(x,y)); |
69 | var unsnappedpos = DrawingToolBase.getHitRecPos(snapManager.snap(point.x, point.y, false)); | 69 | var unsnappedpos = DrawingToolBase.getHitRecPos(snapManager.snap(point.x, point.y, false)); |
70 | this._draggingPlane = snapManager.getDragPlane(); | 70 | this.dragPlane = snapManager.getDragPlane(); |
71 | 71 | ||
72 | snapManager.enableElementSnap(elemSnap); | 72 | snapManager.enableElementSnap(elemSnap); |
73 | snapManager.enableGridSnap(gridSnap); | 73 | snapManager.enableGridSnap(gridSnap); |
@@ -100,7 +100,7 @@ exports.BrushTool = Montage.create(ShapeTool, { | |||
100 | } | 100 | } |
101 | var tmpPoint = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(x,y)); | 101 | var tmpPoint = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(x,y)); |
102 | var hitRec = snapManager.snap(tmpPoint.x, tmpPoint.y, false); | 102 | var hitRec = snapManager.snap(tmpPoint.x, tmpPoint.y, false); |
103 | this._draggingPlane = snapManager.getDragPlane(); | 103 | this.dragPlane = snapManager.getDragPlane(); |
104 | if (this._selectedSubpathCanvas){ | 104 | if (this._selectedSubpathCanvas){ |
105 | snapManager.popWorkingPlane(); | 105 | snapManager.popWorkingPlane(); |
106 | } | 106 | } |
@@ -225,9 +225,11 @@ exports.BrushTool = Montage.create(ShapeTool, { | |||
225 | this._hasDraw = false; | 225 | this._hasDraw = false; |
226 | 226 | ||
227 | //finish giving enough info. to the brush stroke | 227 | //finish giving enough info. to the brush stroke |
228 | this._selectedBrushStroke.setPlaneMatrix(this._brushStrokePlaneMat); | 228 | if (this._selectedBrushStroke){ |
229 | this._selectedBrushStroke.setPlaneMatrixInverse(glmat4.inverse(this._brushStrokePlaneMat,[])); | 229 | this._selectedBrushStroke.setPlaneMatrix(this._brushStrokePlaneMat); |
230 | this._selectedBrushStroke.setDragPlane(this._draggingPlane); | 230 | this._selectedBrushStroke.setPlaneMatrixInverse(glmat4.inverse(this._brushStrokePlaneMat,[])); |
231 | this._selectedBrushStroke.setDragPlane(this.dragPlane); | ||
232 | } | ||
231 | 233 | ||
232 | //display the previously drawn stroke in a separate canvas | 234 | //display the previously drawn stroke in a separate canvas |
233 | this.RenderCurrentBrushStroke(); | 235 | this.RenderCurrentBrushStroke(); |