diff options
Diffstat (limited to 'js/tools/LineTool.js')
-rwxr-xr-x | js/tools/LineTool.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index d2ee0b43..41458d01 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js | |||
@@ -28,23 +28,23 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |||
28 | POSSIBILITY OF SUCH DAMAGE. | 28 | POSSIBILITY OF SUCH DAMAGE. |
29 | </copyright> */ | 29 | </copyright> */ |
30 | 30 | ||
31 | var Montage = require("montage/core/core").Montage, | 31 | var Montage = require("montage/core/core").Montage, |
32 | ShapeTool = require("js/tools/ShapeTool").ShapeTool, | 32 | ShapeTool = require("js/tools/ShapeTool").ShapeTool, |
33 | DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase, | 33 | DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase, |
34 | NJUtils = require("js/lib/NJUtils").NJUtils, | 34 | NJUtils = require("js/lib/NJUtils").NJUtils, |
35 | TagTool = require("js/tools/TagTool").TagTool, | 35 | TagTool = require("js/tools/TagTool").TagTool, |
36 | ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, | 36 | ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, |
37 | ShapeModel = require("js/models/shape-model").ShapeModel; | 37 | ShapeModel = require("js/models/shape-model").ShapeModel; |
38 | 38 | ||
39 | var Line = require("js/lib/geom/line").Line; | 39 | var Line = require("js/lib/geom/line").Line; |
40 | var MaterialsModel = require("js/models/materials-model").MaterialsModel; | 40 | var MaterialsModel = require("js/models/materials-model").MaterialsModel; |
41 | 41 | ||
42 | exports.LineTool = Montage.create(ShapeTool, { | 42 | exports.LineTool = Montage.create(ShapeTool, { |
43 | _toolID: { value: "lineTool" }, | 43 | _toolID: { value: "lineTool" }, |
44 | _imageID: { value: "lineToolImg" }, | 44 | _imageID: { value: "lineToolImg" }, |
45 | _toolImageClass: { value: "lineToolUp" }, | 45 | _toolImageClass: { value: "lineToolUp" }, |
46 | _selectedToolImageClass: { value: "lineToolDown" }, | 46 | _selectedToolImageClass: { value: "lineToolDown" }, |
47 | _toolTipText: { value: "Line Tool (L)" }, | 47 | _toolTipText: { value: "Line Tool (L)" }, |
48 | 48 | ||
49 | _tmpDrawIndex : { value : 1, writable:true}, | 49 | _tmpDrawIndex : { value : 1, writable:true}, |
50 | 50 | ||
@@ -173,10 +173,10 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
173 | slope, | 173 | slope, |
174 | dx, | 174 | dx, |
175 | dy; | 175 | dy; |
176 | 176 | ||
177 | if (hitRec0 && hitRec1) { | 177 | if (hitRec0 && hitRec1) { |
178 | var p0 = hitRec0.getLocalPoint(), | 178 | var p0 = hitRec0.getLocalPoint(), |
179 | p1 = hitRec1.getLocalPoint(); | 179 | p1 = hitRec1.getLocalPoint(); |
180 | 180 | ||
181 | dx = Math.floor(p0[0] - p1[0]); | 181 | dx = Math.floor(p0[0] - p1[0]); |
182 | dy = Math.floor(p0[1] - p1[1]); | 182 | dy = Math.floor(p0[1] - p1[1]); |
@@ -246,7 +246,7 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
246 | }, | 246 | }, |
247 | 247 | ||
248 | RenderShape: { | 248 | RenderShape: { |
249 | value: function (w, h, planeMat, midPt, canvas, slope, xAdj, yAdj) | 249 | value: function (w, h, planeMat, midPt, canvas, slope, xAdj, yAdj) |
250 | { | 250 | { |
251 | 251 | ||
252 | var strokeStyleIndex = this.options.strokeStyleIndex; | 252 | var strokeStyleIndex = this.options.strokeStyleIndex; |
@@ -271,8 +271,8 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
271 | if (strokeMaterial && this.options.stroke.color && (strokeMaterial.gradientType === this.options.stroke.color.gradientMode)) { | 271 | if (strokeMaterial && this.options.stroke.color && (strokeMaterial.gradientType === this.options.stroke.color.gradientMode)) { |
272 | strokeColor = {gradientMode:strokeMaterial.gradientType, color:this.options.stroke.color.stops}; | 272 | strokeColor = {gradientMode:strokeMaterial.gradientType, color:this.options.stroke.color.stops}; |
273 | } else { | 273 | } else { |
274 | strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; | 274 | strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; |
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | var world = this.getGLWorld(canvas, this.options.use3D); | 278 | var world = this.getGLWorld(canvas, this.options.use3D); |