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/components/layout/document-bar.reel/document-bar.js | 1 - js/controllers/elements/stage-controller.js | 2 +- js/stage/tool-handle.js | 15 ++++++++++++++- js/tools/ToolBase.js | 12 ++++++------ 4 files changed, 21 insertions(+), 9 deletions(-) (limited to 'js') diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js index 4dc39fd6..66a02725 100755 --- a/js/components/layout/document-bar.reel/document-bar.js +++ b/js/components/layout/document-bar.reel/document-bar.js @@ -57,7 +57,6 @@ exports.DocumentBar = Montage.create(Component, { this._zoomFactor = value; if (!this._firstDraw) { - var viewUtils = this.application.ninja.stage.viewUtils; this.application.ninja.stage.setZoom(value); } } diff --git a/js/controllers/elements/stage-controller.js b/js/controllers/elements/stage-controller.js index 3ef7dacc..e9779c81 100755 --- a/js/controllers/elements/stage-controller.js +++ b/js/controllers/elements/stage-controller.js @@ -182,5 +182,5 @@ exports.StageController = Montage.create(ElementController, { return dist; } } - }, + } }); 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) diff --git a/js/tools/ToolBase.js b/js/tools/ToolBase.js index 678d03ac..69ac5727 100755 --- a/js/tools/ToolBase.js +++ b/js/tools/ToolBase.js @@ -109,13 +109,13 @@ exports.toolBase = Montage.create(Component, { value:function(event){ var upperBoundary ,previousZoomValue; - previousZoomValue = this.application.Ninja._documentBarRef.zoomFactor ; + previousZoomValue = this.application.ninja.documentBar.zoomFactor; upperBoundary = previousZoomValue *1.2 ; if(upperBoundary > 2000) - this.application.Ninja._documentBarRef.zoomFactor = 2000; + this.application.ninja.documentBar.zoomFactor = 2000; else - this.application.Ninja._documentBarRef.zoomFactor*= 1.2; + this.application.ninja.documentBar.zoomFactor*= 1.2; } }, @@ -124,13 +124,13 @@ exports.toolBase = Montage.create(Component, { value:function(){ var lowerBoundary ,previousZoomValue; - previousZoomValue = this.application.Ninja._documentBarRef.zoomFactor ; + previousZoomValue = this.application.ninja.documentBar.zoomFactor ; lowerBoundary = previousZoomValue/1.2 ; if(lowerBoundary < 25) - this.application.Ninja._documentBarRef.zoomFactor = 25; + this.application.ninja.documentBar.zoomFactor = 25; else - this.application.Ninja._documentBarRef.zoomFactor/= 1.2; + this.application.ninja.documentBar.zoomFactor/= 1.2; } }, -- cgit v1.2.3 From a0daa3668883c8c35ce277b60509a3a3dcf303b2 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 24 Apr 2012 11:42:42 -0700 Subject: Allow users to toggle application of stroke and border settings when using the ink bottle tool. Signed-off-by: Nivesh Rajbhandari --- .../ink-bottle-properties.css | 24 ++++ .../ink-bottle-properties.html | 137 ++++++++++++++++++--- .../ink-bottle-properties.js | 49 +++++--- js/controllers/elements/element-controller.js | 16 ++- js/controllers/elements/shapes-controller.js | 20 ++- js/tools/InkBottleTool.js | 22 ++-- 6 files changed, 215 insertions(+), 53 deletions(-) (limited to 'js') diff --git a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.css b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.css index 7f1b0f7f..a926a0b4 100755 --- a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.css +++ b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.css @@ -4,3 +4,27 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ +.inkBottleProperties input[type="checkbox"].nj-skinned { + float:left; + margin-top:5px; +} + +.inkBottleProperties select.nj-skinned { + float:left; + margin:2px 5px 0 0; +} + +.inkBottleProperties label.disabled { + color:#999999; +} + +.inkBottleProperties label.disabled:hover { + color:#999999; + background-color: transparent; + cursor:default; +} + +.inkBottleProperties div.disabled:hover { + background-color: transparent; + cursor:default; +} \ No newline at end of file diff --git a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html index 1602e793..81facc49 100755 --- a/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html +++ b/js/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html @@ -11,6 +11,30 @@