From c5e66f69b108e359b00c8fd897a4278812484c55 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 20 Apr 2012 12:09:54 -0700 Subject: Fixing translate handles to draw without zoom value. Also fixed some typos in zoom code. Signed-off-by: Nivesh Rajbhandari --- js/stage/tool-handle.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'js/stage/tool-handle.js') diff --git a/js/stage/tool-handle.js b/js/stage/tool-handle.js index d353da47..63cf30e5 100755 --- a/js/stage/tool-handle.js +++ b/js/stage/tool-handle.js @@ -585,7 +585,20 @@ exports.TranslateHandle = Montage.create(ToolHandle, { this._origin = pointOnElt; - var viewMat = viewUtils.getMatrixFromElement(this.application.ninja.currentDocument.documentRoot); + var stage = this.application.ninja.currentDocument.documentRoot; + var viewMat = viewUtils.getMatrixFromElement(stage); + // Get viewMat without zoom value + var zoom = this.application.ninja.documentBar.zoomFactor/100; + if(zoom !== 1) + { + var zoomMatInv = Matrix.create( [ + [ 1/zoom, 0, 0, 0], + [ 0, 1/zoom, 0, 0], + [ 0, 0, 1/zoom, 0], + [ 0, 0, 0, 1] + ] ); + glmat4.multiply( zoomMatInv, viewMat, viewMat ); + } var transMat = viewMat.slice(0); if(inLocalMode) -- cgit v1.2.3