aboutsummaryrefslogtreecommitdiff
path: root/js/tools/OvalTool.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-03-06 11:18:30 -0800
committerJose Antonio Marquez2012-03-06 11:18:30 -0800
commit3c4967fa93b3abc529fc404115707307ba72d5cd (patch)
treef3737db979727ee050f8b9c85ef994b0e6ddae27 /js/tools/OvalTool.js
parentbee2df0d4da72677aaa2adae669ffdd4ac210dd6 (diff)
parent84332ab81c1b445195f1d9be8bbeae0725c8e758 (diff)
downloadninja-3c4967fa93b3abc529fc404115707307ba72d5cd.tar.gz
Merge branch 'refs/heads/Ninja-Internal' into FileIO
Diffstat (limited to 'js/tools/OvalTool.js')
-rwxr-xr-xjs/tools/OvalTool.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js
index 911059a7..a10e0bb5 100755
--- a/js/tools/OvalTool.js
+++ b/js/tools/OvalTool.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 Circle = require("js/lib/geom/circle").Circle;
12var MaterialsModel = require("js/models/materials-model").MaterialsModel;
13
11exports.OvalTool = Montage.create(ShapeTool, { 14exports.OvalTool = Montage.create(ShapeTool, {
12 15
13 _toolID: { value: "ovalTool" }, 16 _toolID: { value: "ovalTool" },
@@ -48,13 +51,13 @@ exports.OvalTool = Montage.create(ShapeTool, {
48 var strokeM = this.options.strokeMaterial; 51 var strokeM = this.options.strokeMaterial;
49 if(strokeM) 52 if(strokeM)
50 { 53 {
51 strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); 54 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM));
52 } 55 }
53 56
54 var fillM = this.options.fillMaterial; 57 var fillM = this.options.fillMaterial;
55 if(fillM) 58 if(fillM)
56 { 59 {
57 fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM)); 60 fillMaterial = Object.create(MaterialsModel.getMaterial(fillM));
58 } 61 }
59 } 62 }
60 63
@@ -63,7 +66,7 @@ exports.OvalTool = Montage.create(ShapeTool, {
63 var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2); 66 var xOffset = ((left - canvas.offsetLeft + w/2) - canvas.width/2);
64 var yOffset = (canvas.height/2 - (top - canvas.offsetTop + h/2)); 67 var yOffset = (canvas.height/2 - (top - canvas.offsetTop + h/2));
65 68
66 var oval = new GLCircle(); 69 var oval = new Circle(); //GLCircle();
67 oval.init(world, xOffset, yOffset, w, h, strokeSize, strokeColor, fillColor, innerRadius, strokeMaterial, fillMaterial, strokeStyle); 70 oval.init(world, xOffset, yOffset, w, h, strokeSize, strokeColor, fillColor, innerRadius, strokeMaterial, fillMaterial, strokeStyle);
68 71
69 world.addObject(oval); 72 world.addObject(oval);