diff options
Diffstat (limited to 'js/tools/PanTool.js')
-rwxr-xr-x | js/tools/PanTool.js | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/js/tools/PanTool.js b/js/tools/PanTool.js index 374886e8..cab25726 100755 --- a/js/tools/PanTool.js +++ b/js/tools/PanTool.js | |||
@@ -95,12 +95,9 @@ exports.PanTool = Montage.create(toolBase, | |||
95 | } | 95 | } |
96 | }, | 96 | }, |
97 | 97 | ||
98 | HandleLeftButtonUp: | 98 | HandleLeftButtonUp: { |
99 | { | 99 | value: function(event) { |
100 | value : function ( event ) | 100 | //if(this._isDrawing) { |
101 | { | ||
102 | //if(this._isDrawing) | ||
103 | { | ||
104 | // do one final mouse move to update the scrollbars | 101 | // do one final mouse move to update the scrollbars |
105 | this.mouseUp( event ); | 102 | this.mouseUp( event ); |
106 | 103 | ||
@@ -108,7 +105,7 @@ exports.PanTool = Montage.create(toolBase, | |||
108 | this._hasDraw = false; | 105 | this._hasDraw = false; |
109 | this._isDrawing = false; | 106 | this._isDrawing = false; |
110 | this.isDrawing = false; | 107 | this.isDrawing = false; |
111 | } | 108 | //} |
112 | } | 109 | } |
113 | }, | 110 | }, |
114 | 111 | ||
@@ -234,11 +231,10 @@ exports.PanTool = Montage.create(toolBase, | |||
234 | }, | 231 | }, |
235 | 232 | ||
236 | 233 | ||
237 | doMouseDown: | 234 | doMouseDown: { |
238 | { | 235 | value: function(point) { |
239 | value: function( point ) | ||
240 | { | ||
241 | //var tmpPt, tmpPt2, tmpPt3, tmpPt4, tmpMat, tmpMat2; // DEBUG. (see use of these points below) | 236 | //var tmpPt, tmpPt2, tmpPt3, tmpPt4, tmpMat, tmpMat2; // DEBUG. (see use of these points below) |
237 | var cop; | ||
242 | var hitRec = snapManager.snap( point.x, point.y, true ); | 238 | var hitRec = snapManager.snap( point.x, point.y, true ); |
243 | if (hitRec) | 239 | if (hitRec) |
244 | { | 240 | { |
@@ -260,7 +256,7 @@ exports.PanTool = Montage.create(toolBase, | |||
260 | { | 256 | { |
261 | var localPt = hitRec.calculateElementWorldPoint(); | 257 | var localPt = hitRec.calculateElementWorldPoint(); |
262 | viewUtils.pushViewportObj( userContent ); | 258 | viewUtils.pushViewportObj( userContent ); |
263 | var cop = viewUtils.getCenterOfProjection(); | 259 | cop = viewUtils.getCenterOfProjection(); |
264 | this._localPt = [cop[0] + localPt[0], cop[1] + localPt[1], localPt[2]]; | 260 | this._localPt = [cop[0] + localPt[0], cop[1] + localPt[1], localPt[2]]; |
265 | viewUtils.popViewportObj(); | 261 | viewUtils.popViewportObj(); |
266 | } | 262 | } |
@@ -284,7 +280,7 @@ exports.PanTool = Montage.create(toolBase, | |||
284 | 280 | ||
285 | // get a matrix from user content world space to the screen | 281 | // get a matrix from user content world space to the screen |
286 | viewUtils.pushViewportObj( userContent ); | 282 | viewUtils.pushViewportObj( userContent ); |
287 | var cop = viewUtils.getCenterOfProjection(); | 283 | cop = viewUtils.getCenterOfProjection(); |
288 | var pDist = viewUtils.getPerspectiveDistFromElement(userContent); | 284 | var pDist = viewUtils.getPerspectiveDistFromElement(userContent); |
289 | var projMat = glmat4.scale(Matrix.I(4), [pDist,pDist,pDist], []); | 285 | var projMat = glmat4.scale(Matrix.I(4), [pDist,pDist,pDist], []); |
290 | projMat[11] = -1; | 286 | projMat[11] = -1; |