aboutsummaryrefslogtreecommitdiff
path: root/js/tools/OvalTool.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-03-06 14:09:44 -0800
committerNivesh Rajbhandari2012-03-06 14:09:44 -0800
commit792793cd3991032b4840ade67f98ae8eae2d30a0 (patch)
tree69d3df003d2bb58fa1ab562fbd1058ff91851f01 /js/tools/OvalTool.js
parent2346d8ab9db06573d8672c64988c46b6c672e015 (diff)
parent1cd89d4d06e3a8f2c221628b19cf26a2c69f5d3f (diff)
downloadninja-792793cd3991032b4840ade67f98ae8eae2d30a0.tar.gz
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
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);