diff options
author | Pushkar Joshi | 2012-05-21 08:40:40 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-05-21 08:40:40 -0700 |
commit | 11cfa9ef2871002b600f1c18f4e06e55a826163c (patch) | |
tree | 381b23b0fa86cdf283a0da7a1b7d532a94e89db4 /js/tools/LineTool.js | |
parent | 4cb3612c9a67f4020d2949b5e5e5d84a90017974 (diff) | |
parent | c37a876b373ddc7cb19277aaeaa6bb2d2d5a50ac (diff) | |
download | ninja-11cfa9ef2871002b600f1c18f4e06e55a826163c.tar.gz |
Merge branch 'master' into pentool
Diffstat (limited to 'js/tools/LineTool.js')
-rwxr-xr-x | js/tools/LineTool.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index 5941b464..b2b48383 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js | |||
@@ -44,8 +44,8 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
44 | } | 44 | } |
45 | 45 | ||
46 | this._strokeSize = ShapesController.GetValueInPixels(this.options.strokeSize.value, this.options.strokeSize.units, null); | 46 | this._strokeSize = ShapesController.GetValueInPixels(this.options.strokeSize.value, this.options.strokeSize.units, null); |
47 | if (this.application.ninja.colorController.colorToolbar.stroke.color) | 47 | if (this.options.stroke.color) |
48 | this._strokeColor = this.application.ninja.colorController.colorToolbar.stroke.color.css; | 48 | this._strokeColor = this.options.stroke.color.css; |
49 | else | 49 | else |
50 | this._strokeColor = [0,0,0,1]; | 50 | this._strokeColor = [0,0,0,1]; |
51 | this.startDraw(event); | 51 | this.startDraw(event); |
@@ -215,7 +215,7 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
215 | var left = Math.round(midPt[0] - 0.5*w); | 215 | var left = Math.round(midPt[0] - 0.5*w); |
216 | var top = Math.round(midPt[1] - 0.5*h); | 216 | var top = Math.round(midPt[1] - 0.5*h); |
217 | 217 | ||
218 | var strokeColor = this.application.ninja.colorController.colorToolbar.stroke.webGlColor; | 218 | var strokeColor = this.options.stroke.webGlColor; |
219 | // for default stroke and fill/no materials | 219 | // for default stroke and fill/no materials |
220 | var strokeMaterial = null; | 220 | var strokeMaterial = null; |
221 | 221 | ||
@@ -234,7 +234,8 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
234 | var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2); | 234 | var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2); |
235 | var yOffset = (canvas.height/2 - (top - canvas.offsetTop + h/2)); | 235 | var yOffset = (canvas.height/2 - (top - canvas.offsetTop + h/2)); |
236 | 236 | ||
237 | var line = new Line(world, xOffset, yOffset, w, h, slope, strokeSize, strokeColor, strokeMaterial, strokeStyle, xAdj, yAdj); | 237 | var line = Object.create(Line, {}); |
238 | line.init(world, xOffset, yOffset, w, h, slope, strokeSize, strokeColor, strokeMaterial, strokeStyle, xAdj, yAdj); | ||
238 | 239 | ||
239 | world.addObject(line); | 240 | world.addObject(line); |
240 | world.render(); | 241 | world.render(); |