diff options
author | Jon Reid | 2012-03-06 14:14:01 -0800 |
---|---|---|
committer | Jon Reid | 2012-03-06 14:14:01 -0800 |
commit | 60bba95eaffa8b5c741c6c85fb84b327cd75d6c3 (patch) | |
tree | 0087ad093418638ff1d0b4362715bd7b2d147eba /js/tools/RectTool.js | |
parent | d64f8c9fc1dd5fb15ad78ad61bed1ef3736321bb (diff) | |
parent | 342fb451bd251358068a0dcb10e9dc218b79a176 (diff) | |
download | ninja-60bba95eaffa8b5c741c6c85fb84b327cd75d6c3.tar.gz |
Merge remote-tracking branch 'ninja-jduran/TimelineUber' into Timeline-uber
Diffstat (limited to 'js/tools/RectTool.js')
-rwxr-xr-x | js/tools/RectTool.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js index 31ac7faa..957afea9 100755 --- a/js/tools/RectTool.js +++ b/js/tools/RectTool.js | |||
@@ -8,6 +8,9 @@ var Montage = require("montage/core/core").Montage, | |||
8 | ShapeTool = require("js/tools/ShapeTool").ShapeTool, | 8 | ShapeTool = require("js/tools/ShapeTool").ShapeTool, |
9 | ShapesController = require("js/controllers/elements/shapes-controller").ShapesController; | 9 | ShapesController = require("js/controllers/elements/shapes-controller").ShapesController; |
10 | 10 | ||
11 | var Rectangle = require("js/lib/geom/rectangle").Rectangle; | ||
12 | var MaterialsModel = require("js/models/materials-model").MaterialsModel; | ||
13 | |||
11 | exports.RectTool = Montage.create(ShapeTool, { | 14 | exports.RectTool = Montage.create(ShapeTool, { |
12 | 15 | ||
13 | _toolID: { value: "rectTool" }, | 16 | _toolID: { value: "rectTool" }, |
@@ -62,16 +65,19 @@ exports.RectTool = Montage.create(ShapeTool, { | |||
62 | var strokeMaterial = null; | 65 | var strokeMaterial = null; |
63 | var fillMaterial = null; | 66 | var fillMaterial = null; |
64 | 67 | ||
65 | var strokeM = this.options.strokeMaterial; | 68 | if(this.options.use3D) |
66 | if(strokeM) | ||
67 | { | 69 | { |
68 | strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); | 70 | var strokeM = this.options.strokeMaterial; |
69 | } | 71 | if(strokeM) |
72 | { | ||
73 | strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); | ||
74 | } | ||
70 | 75 | ||
71 | var fillM = this.options.fillMaterial; | 76 | var fillM = this.options.fillMaterial; |
72 | if(fillM) | 77 | if(fillM) |
73 | { | 78 | { |
74 | fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM)); | 79 | fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); |
80 | } | ||
75 | } | 81 | } |
76 | 82 | ||
77 | var world = this.getGLWorld(canvas, this.options.use3D); | 83 | var world = this.getGLWorld(canvas, this.options.use3D); |
@@ -79,7 +85,7 @@ exports.RectTool = Montage.create(ShapeTool, { | |||
79 | var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2); | 85 | var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2); |
80 | var yOffset = (canvas.height/2 - (top - canvas.offsetTop + h/2)); | 86 | var yOffset = (canvas.height/2 - (top - canvas.offsetTop + h/2)); |
81 | 87 | ||
82 | var rect = new GLRectangle(); | 88 | var rect = new Rectangle(); |
83 | rect.init(world, xOffset, yOffset, w, h, strokeSize, strokeColor, fillColor, | 89 | rect.init(world, xOffset, yOffset, w, h, strokeSize, strokeColor, fillColor, |
84 | tlRadius, trRadius, blRadius, brRadius, strokeMaterial, fillMaterial, strokeStyle); | 90 | tlRadius, trRadius, blRadius, brRadius, strokeMaterial, fillMaterial, strokeStyle); |
85 | 91 | ||