diff options
author | Valerio Virgillito | 2012-04-25 14:45:47 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-04-25 14:45:47 -0700 |
commit | bcc8f8616f5ad4bf310928da6cbc01da12f6e468 (patch) | |
tree | 9f3d5f6f4c429a1b4912e835e1cbdf704b59def5 /js/tools | |
parent | d3a6350163ada5644d34ed8d5c2a00cef4db2afc (diff) | |
parent | d5510229ebd4549ce435e3947874cc37eef27ffb (diff) | |
download | ninja-bcc8f8616f5ad4bf310928da6cbc01da12f6e468.tar.gz |
Merge pull request #175 from mqg734/BoundsCalculation
Allow users to toggle application of stroke and border settings when using the ink bottle tool. Also, fixed translate tool's handles to draw without stage's zoom.
Diffstat (limited to 'js/tools')
-rwxr-xr-x | js/tools/InkBottleTool.js | 22 | ||||
-rwxr-xr-x | js/tools/ToolBase.js | 12 |
2 files changed, 21 insertions, 13 deletions
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, { | |||
84 | }; | 84 | }; |
85 | } | 85 | } |
86 | 86 | ||
87 | colorInfo.borderInfo = { borderStyle:this.options._borderStyle.value, | 87 | if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) { |
88 | borderWidth:this.options._borderWidth.value, | 88 | colorInfo.borderInfo = {}; |
89 | borderUnits:this.options._borderWidth.units | 89 | if(this.options.useBorderWidth.checked) { |
90 | }; | 90 | colorInfo.borderInfo.borderWidth = this.options._borderWidth.value; |
91 | colorInfo.borderInfo.borderUnits = this.options._borderWidth.units; | ||
92 | } | ||
93 | if(this.options.useBorderStyle.checked) { | ||
94 | colorInfo.borderInfo.borderStyle = this.options._borderStyle.value; | ||
95 | } | ||
96 | } | ||
91 | 97 | ||
92 | colorInfo.strokeInfo = { strokeSize:this.options._strokeSize.value, | 98 | if(this.options.useStrokeSize.checked) { |
93 | strokeUnits:this.options._strokeSize.units | 99 | colorInfo.strokeInfo = {}; |
94 | }; | 100 | colorInfo.strokeInfo.strokeSize = this.options._strokeSize.value; |
101 | colorInfo.strokeInfo.strokeUnits = this.options._strokeSize.units; | ||
102 | } | ||
95 | 103 | ||
96 | ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, false, "Change", "inkBottleTool"); | 104 | ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, false, "Change", "inkBottleTool"); |
97 | } | 105 | } |
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, { | |||
109 | value:function(event){ | 109 | value:function(event){ |
110 | var upperBoundary ,previousZoomValue; | 110 | var upperBoundary ,previousZoomValue; |
111 | 111 | ||
112 | previousZoomValue = this.application.Ninja._documentBarRef.zoomFactor ; | 112 | previousZoomValue = this.application.ninja.documentBar.zoomFactor; |
113 | upperBoundary = previousZoomValue *1.2 ; | 113 | upperBoundary = previousZoomValue *1.2 ; |
114 | 114 | ||
115 | if(upperBoundary > 2000) | 115 | if(upperBoundary > 2000) |
116 | this.application.Ninja._documentBarRef.zoomFactor = 2000; | 116 | this.application.ninja.documentBar.zoomFactor = 2000; |
117 | else | 117 | else |
118 | this.application.Ninja._documentBarRef.zoomFactor*= 1.2; | 118 | this.application.ninja.documentBar.zoomFactor*= 1.2; |
119 | 119 | ||
120 | } | 120 | } |
121 | }, | 121 | }, |
@@ -124,13 +124,13 @@ exports.toolBase = Montage.create(Component, { | |||
124 | value:function(){ | 124 | value:function(){ |
125 | var lowerBoundary ,previousZoomValue; | 125 | var lowerBoundary ,previousZoomValue; |
126 | 126 | ||
127 | previousZoomValue = this.application.Ninja._documentBarRef.zoomFactor ; | 127 | previousZoomValue = this.application.ninja.documentBar.zoomFactor ; |
128 | lowerBoundary = previousZoomValue/1.2 ; | 128 | lowerBoundary = previousZoomValue/1.2 ; |
129 | 129 | ||
130 | if(lowerBoundary < 25) | 130 | if(lowerBoundary < 25) |
131 | this.application.Ninja._documentBarRef.zoomFactor = 25; | 131 | this.application.ninja.documentBar.zoomFactor = 25; |
132 | else | 132 | else |
133 | this.application.Ninja._documentBarRef.zoomFactor/= 1.2; | 133 | this.application.ninja.documentBar.zoomFactor/= 1.2; |
134 | } | 134 | } |
135 | }, | 135 | }, |
136 | 136 | ||