diff options
Diffstat (limited to 'js/tools')
-rw-r--r-- | js/tools/ZoomTool.js | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/js/tools/ZoomTool.js b/js/tools/ZoomTool.js index cabf3a3d..913dc02a 100644 --- a/js/tools/ZoomTool.js +++ b/js/tools/ZoomTool.js | |||
@@ -74,10 +74,12 @@ exports.ZoomTool = Montage.create(DrawingTool, { | |||
74 | if(wasSelected) { | 74 | if(wasSelected) { |
75 | this.AddCustomFeedback(); | 75 | this.AddCustomFeedback(); |
76 | this.eventManager.addEventListener( "toolDoubleClick", this, false); | 76 | this.eventManager.addEventListener( "toolDoubleClick", this, false); |
77 | this.application.ninja.stage.drawingCanvas.addEventListener("mousewheel", this, false); | ||
77 | 78 | ||
78 | } else { | 79 | } else { |
79 | this.RemoveCustomFeedback(); | 80 | this.RemoveCustomFeedback(); |
80 | this.eventManager.removeEventListener( "toolDoubleClick", this, false); | 81 | this.eventManager.removeEventListener( "toolDoubleClick", this, false); |
82 | this.application.ninja.stage.drawingCanvas.removeEventListener("mousewheel", this, false); | ||
81 | } | 83 | } |
82 | } | 84 | } |
83 | }, | 85 | }, |
@@ -270,19 +272,9 @@ exports.ZoomTool = Montage.create(DrawingTool, { | |||
270 | } | 272 | } |
271 | else if (this._mode === "mouseWheelZoom") | 273 | else if (this._mode === "mouseWheelZoom") |
272 | { | 274 | { |
273 | if (userContent) | 275 | var w = this.application.ninja.stage._canvas.width, |
274 | { | 276 | h = this.application.ninja.stage._canvas.height; |
275 | var w = userContent.offsetWidth, | 277 | globalPt = [w/2, h/2, 0]; |
276 | h = userContent.offsetHeight; | ||
277 | if(userContent.width) | ||
278 | w = userContent.width; | ||
279 | if(userContent.height) | ||
280 | h = userContent.height; | ||
281 | var localPt = [ w/2, h/2, 0]; | ||
282 | globalPt = viewUtils.localToGlobal( localPt, userContent ); | ||
283 | } | ||
284 | else | ||
285 | globalPt = [0,0,0]; | ||
286 | } | 278 | } |
287 | else | 279 | else |
288 | { | 280 | { |