diff options
author | Jose Antonio Marquez | 2012-03-06 11:18:30 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-03-06 11:18:30 -0800 |
commit | 3c4967fa93b3abc529fc404115707307ba72d5cd (patch) | |
tree | f3737db979727ee050f8b9c85ef994b0e6ddae27 /js/tools/RectTool.js | |
parent | bee2df0d4da72677aaa2adae669ffdd4ac210dd6 (diff) | |
parent | 84332ab81c1b445195f1d9be8bbeae0725c8e758 (diff) | |
download | ninja-3c4967fa93b3abc529fc404115707307ba72d5cd.tar.gz |
Merge branch 'refs/heads/Ninja-Internal' into FileIO
Diffstat (limited to 'js/tools/RectTool.js')
-rwxr-xr-x | js/tools/RectTool.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js index 5e148de3..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" }, |
@@ -67,13 +70,13 @@ exports.RectTool = Montage.create(ShapeTool, { | |||
67 | var strokeM = this.options.strokeMaterial; | 70 | var strokeM = this.options.strokeMaterial; |
68 | if(strokeM) | 71 | if(strokeM) |
69 | { | 72 | { |
70 | strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); | 73 | strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); |
71 | } | 74 | } |
72 | 75 | ||
73 | var fillM = this.options.fillMaterial; | 76 | var fillM = this.options.fillMaterial; |
74 | if(fillM) | 77 | if(fillM) |
75 | { | 78 | { |
76 | fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM)); | 79 | fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); |
77 | } | 80 | } |
78 | } | 81 | } |
79 | 82 | ||
@@ -82,7 +85,7 @@ exports.RectTool = Montage.create(ShapeTool, { | |||
82 | var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2); | 85 | var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2); |
83 | var yOffset = (canvas.height/2 - (top - canvas.offsetTop + h/2)); | 86 | var yOffset = (canvas.height/2 - (top - canvas.offsetTop + h/2)); |
84 | 87 | ||
85 | var rect = new GLRectangle(); | 88 | var rect = new Rectangle(); |
86 | rect.init(world, xOffset, yOffset, w, h, strokeSize, strokeColor, fillColor, | 89 | rect.init(world, xOffset, yOffset, w, h, strokeSize, strokeColor, fillColor, |
87 | tlRadius, trRadius, blRadius, brRadius, strokeMaterial, fillMaterial, strokeStyle); | 90 | tlRadius, trRadius, blRadius, brRadius, strokeMaterial, fillMaterial, strokeStyle); |
88 | 91 | ||