From e93827d6c157c7648eb52e6c10b7f458b215b580 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 23 Mar 2012 07:34:11 -0700 Subject: Timeline : Bug Fix : IKNINJA 1374 Signed-off-by: Kruti Shah Signed-off-by: Jonathan Duran --- js/tools/SelectionTool.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index f9411f48..3db51501 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -223,8 +223,10 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { HandleDoubleClick: { value: function(event) { if(this.application.ninja.selectedElements.length > 0) { + this.application.ninja.breadCrumbClick = true; this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]._element; } else { + this.application.ninja.breadCrumbClick = true; this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; } } -- cgit v1.2.3 From a9050f96d814469f420bcf3630d16d576b62258e Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Fri, 6 Apr 2012 12:10:48 -0700 Subject: Breadcrumb Fix Signed-off-by: Kruti Shah --- js/tools/SelectionTool.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index ea2379bb..7120e18f 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -223,6 +223,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { HandleDoubleClick: { value: function(event) { if(this.application.ninja.selectedElements.length > 0) { + this.application.ninja.breadCrumbClick = true; this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]; } else { this.application.ninja.breadCrumbClick = true; -- cgit v1.2.3 From b7d5b9e9b69644cdafdcc9b7ef2fe2674f35db18 Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Thu, 19 Apr 2012 13:48:28 -0700 Subject: BreadCrumb Bug Fix Signed-off-by: Kruti Shah --- js/tools/SelectionTool.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index eb5341de..78eda1b7 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -224,10 +224,10 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { HandleDoubleClick: { value: function(event) { if(this.application.ninja.selectedElements.length > 0) { - this.application.ninja.breadCrumbClick = true; + this.application.ninja.currentDocument.breadCrumbClick = true; this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]; } else { - this.application.ninja.breadCrumbClick = true; + this.application.ninja.currentDocument.breadCrumbClick = true; this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; } } -- cgit v1.2.3 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/tools/ToolBase.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'js/tools') 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 933338e13e73243965d105170a269a41f7efd77f Mon Sep 17 00:00:00 2001 From: Kruti Shah Date: Fri, 20 Apr 2012 16:25:36 -0700 Subject: Breadcrumb Fix Signed-off-by: Kruti Shah --- js/tools/SelectionTool.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index 30e56b28..414f9d11 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -221,10 +221,10 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { HandleDoubleClick: { value: function(event) { if(this.application.ninja.selectedElements.length > 0) { - this.application.ninja.currentDocument.breadCrumbClick = true; +// this.application.ninja.currentDocument.breadCrumbClick = true; this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]; } else { - this.application.ninja.currentDocument.breadCrumbClick = true; +// this.application.ninja.currentDocument.breadCrumbClick = true; this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; } } -- cgit v1.2.3 From 0475cb7e37601366ec07d77fcea44269d3d49633 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Mon, 23 Apr 2012 11:36:09 -0700 Subject: Fix Pen Tool not broadcasting elementAdded event Signed-off-by: Jonathan Duran --- js/tools/PenTool.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/tools') diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 7fc8dd95..3ffe0b62 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js @@ -619,6 +619,8 @@ exports.PenTool = Montage.create(ShapeTool, { // TODO - update the shape's info only. shapeModel will likely need an array of shapes. } + NJevent("elementAdded", newCanvas); + if(newCanvas.elementModel.isShape) { this.application.ninja.selectionController.selectElement(newCanvas); -- cgit v1.2.3 From 12fadd1494a9b5fcdaa17fde2f4847277237cf79 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Mon, 23 Apr 2012 11:47:15 -0700 Subject: Fix Brush tool not broadcasting elementAdded event Signed-off-by: Jonathan Duran --- js/tools/BrushTool.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/tools') diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index 4347658a..34a3c3ff 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js @@ -343,6 +343,8 @@ exports.BrushTool = Montage.create(ShapeTool, { // TODO - update the shape's info only. shapeModel will likely need an array of shapes. } + NJevent("elementAdded", newCanvas); + //if(newCanvas.elementModel.isShape) if (true) { -- 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 --- js/tools/InkBottleTool.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'js/tools') diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index 95c2e71d..960c19fa 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js @@ -84,14 +84,22 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { }; } - colorInfo.borderInfo = { borderStyle:this.options._borderStyle.value, - borderWidth:this.options._borderWidth.value, - borderUnits:this.options._borderWidth.units - }; + if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) { + colorInfo.borderInfo = {}; + if(this.options.useBorderWidth.checked) { + colorInfo.borderInfo.borderWidth = this.options._borderWidth.value; + colorInfo.borderInfo.borderUnits = this.options._borderWidth.units; + } + if(this.options.useBorderStyle.checked) { + colorInfo.borderInfo.borderStyle = this.options._borderStyle.value; + } + } - colorInfo.strokeInfo = { strokeSize:this.options._strokeSize.value, - strokeUnits:this.options._strokeSize.units - }; + if(this.options.useStrokeSize.checked) { + colorInfo.strokeInfo = {}; + colorInfo.strokeInfo.strokeSize = this.options._strokeSize.value; + colorInfo.strokeInfo.strokeUnits = this.options._strokeSize.units; + } ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, false, "Change", "inkBottleTool"); } -- cgit v1.2.3 From ef704fcb6b1bb290eb45b6685b073e2932237a68 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Wed, 25 Apr 2012 08:15:11 -0700 Subject: Revert "Fix Pen Tool not broadcasting elementAdded event" This reverts commit 0475cb7e37601366ec07d77fcea44269d3d49633. Signed-off-by: Jonathan Duran --- js/tools/PenTool.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'js/tools') diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 3ffe0b62..7fc8dd95 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js @@ -619,8 +619,6 @@ exports.PenTool = Montage.create(ShapeTool, { // TODO - update the shape's info only. shapeModel will likely need an array of shapes. } - NJevent("elementAdded", newCanvas); - if(newCanvas.elementModel.isShape) { this.application.ninja.selectionController.selectElement(newCanvas); -- cgit v1.2.3 From 238586be0df568c6804268d97bf9d3ef7cd33fda Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 26 Apr 2012 15:33:48 -0700 Subject: Simplifying the getElement method from stage and adding an exclusion list to the new template Signed-off-by: Valerio Virgillito --- js/tools/EyedropperTool.js | 2 +- js/tools/FillTool.js | 2 +- js/tools/InkBottleTool.js | 2 +- js/tools/ShapeTool.js | 2 +- js/tools/ToolBase.js | 4 ++-- js/tools/TranslateObject3DTool.js | 2 +- js/tools/modifier-tool-base.js | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'js/tools') diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js index d627f03b..346975b2 100755 --- a/js/tools/EyedropperTool.js +++ b/js/tools/EyedropperTool.js @@ -104,7 +104,7 @@ exports.EyedropperTool = Montage.create(toolBase, { value : function (event) { var c, color, - obj = this.application.ninja.stage.GetElement(event); + obj = this.application.ninja.stage.getElement(event); if (obj) { if(this.application.ninja.currentDocument.inExclusion(obj) !== -1) diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js index 746f20cf..87a093ff 100755 --- a/js/tools/FillTool.js +++ b/js/tools/FillTool.js @@ -22,7 +22,7 @@ exports.FillTool = Montage.create(ModifierToolBase, { HandleMouseMove: { value : function (event) { - var obj = this.application.ninja.stage.GetSelectableElement(event); + var obj = this.application.ninja.stage.getElement(event, true); var cursor = "url('images/cursors/fill.png') 14 14, default"; var canColor = true; if (obj) diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index 960c19fa..fd17f4d6 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js @@ -16,7 +16,7 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { HandleMouseMove: { value : function (event) { - var obj = this.application.ninja.stage.GetSelectableElement(event); + var obj = this.application.ninja.stage.getElement(event, true); var cursor = "url('images/cursors/ink.png') 6 11, default"; var canColor = true; if (obj) diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index f3b5e92d..21a5a025 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js @@ -138,7 +138,7 @@ exports.ShapeTool = Montage.create(DrawingTool, { _showFeedbackOnMouseMove: { value: function (event) { // TODO - This call is causing the canvas to redraw 3 times per mouse move - var targetedObject = this.application.ninja.stage.GetSelectableElement(event); + var targetedObject = this.application.ninja.stage.getElement(event, true); if (targetedObject) { if((targetedObject.nodeName === "CANVAS") && !ShapesController.isElementAShape(targetedObject)) diff --git a/js/tools/ToolBase.js b/js/tools/ToolBase.js index 69ac5727..f43b1b58 100755 --- a/js/tools/ToolBase.js +++ b/js/tools/ToolBase.js @@ -89,9 +89,9 @@ exports.toolBase = Montage.create(Component, { if(this._canOperateOnStage) { if(event.shiftKey) { - this.application.ninja.selectionController.shiftSelectElement(this.application.ninja.stage.GetElement(event)); + this.application.ninja.selectionController.shiftSelectElement(this.application.ninja.stage.getElement(event)); } else { - this.application.ninja.selectionController.selectElement(this.application.ninja.stage.GetElement(event)); + this.application.ninja.selectionController.selectElement(this.application.ninja.stage.getElement(event)); } } diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js index 72a55322..b4f55bd9 100755 --- a/js/tools/TranslateObject3DTool.js +++ b/js/tools/TranslateObject3DTool.js @@ -83,7 +83,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { // Check that hitRec's element matches element that browser says we clicked on // TODO - This is still not working when using a handle that is on top of an // element that is not currently selected - var elt = this.application.ninja.stage.GetSelectableElement(event); + var elt = this.application.ninja.stage.getElement(event, true); if(elt && (elt !== hitRec.getElement())) { hitRec = snapManager.findHitRecordForElement(elt); diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js index 2e006c35..d023206a 100755 --- a/js/tools/modifier-tool-base.js +++ b/js/tools/modifier-tool-base.js @@ -134,7 +134,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { var hitRec = snapManager.snap(point.x, point.y, do3DSnap); // TODO - Check that hitRec's element matches element that browser says we clicked on - var elt = this.application.ninja.stage.GetSelectableElement(event); + var elt = this.application.ninja.stage.getElement(event, true); if(elt !== hitRec.getElement()) { hitRec = snapManager.findHitRecordForElement(elt); -- cgit v1.2.3 From 185dae2438e680acfe8c974dc5d653000c380066 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 27 Apr 2012 11:47:36 -0700 Subject: Revert "Fix Brush tool not broadcasting elementAdded event" This reverts commit 12fadd1494a9b5fcdaa17fde2f4847277237cf79. Signed-off-by: Jonathan Duran --- js/tools/BrushTool.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'js/tools') diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index 94958fd6..6cd6858c 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js @@ -342,8 +342,6 @@ exports.BrushTool = Montage.create(ShapeTool, { // TODO - update the shape's info only. shapeModel will likely need an array of shapes. } - NJevent("elementAdded", newCanvas); - //if(newCanvas.elementModel.isShape) if (true) { -- cgit v1.2.3 From 69dba9ace7a1b77f57ee418abfc2e0fd0e0a9896 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 27 Apr 2012 11:50:06 -0700 Subject: Refix brush tool elementAdded event Signed-off-by: Jonathan Duran --- js/tools/BrushTool.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/tools') diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index 4e13bd43..ded56ecc 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js @@ -417,6 +417,9 @@ exports.BrushTool = Montage.create(ShapeTool, { // TODO - update the shape's info only. shapeModel will likely need an array of shapes. } + //now send the event that will add this canvas to the timeline + NJevent("elementAdded", newCanvas); + //if(newCanvas.elementModel.isShape) if (true) { -- cgit v1.2.3 From c8fac64d4ad8ac18744a17a5e0f0d17204355fd6 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 27 Apr 2012 14:26:41 -0700 Subject: Merge cleanup Signed-off-by: Valerio Virgillito --- js/tools/SelectionTool.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index 414f9d11..7033ee3d 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -221,10 +221,8 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { HandleDoubleClick: { value: function(event) { if(this.application.ninja.selectedElements.length > 0) { -// this.application.ninja.currentDocument.breadCrumbClick = true; this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]; } else { -// this.application.ninja.currentDocument.breadCrumbClick = true; this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; } } -- cgit v1.2.3