aboutsummaryrefslogtreecommitdiff
path: root/js/tools/RectTool.js
diff options
context:
space:
mode:
authorPushkar Joshi2012-03-06 17:05:05 -0800
committerPushkar Joshi2012-03-06 17:05:05 -0800
commit794abd077a0cd4c797d3f566281deca77b184bfe (patch)
tree3bf4a83ca714def2671fe8cef93db859b0d5553f /js/tools/RectTool.js
parentc155cd238b6f9e0b8191e0fc533f7bc974b762c2 (diff)
parent2e3943a8f751ec572066f168b58464c24b9f29e5 (diff)
downloadninja-794abd077a0cd4c797d3f566281deca77b184bfe.tar.gz
Merge branch 'master' into pentool
Diffstat (limited to 'js/tools/RectTool.js')
-rwxr-xr-xjs/tools/RectTool.js9
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
11var Rectangle = require("js/lib/geom/rectangle").Rectangle;
12var MaterialsModel = require("js/models/materials-model").MaterialsModel;
13
11exports.RectTool = Montage.create(ShapeTool, { 14exports.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