diff options
author | Valerio Virgillito | 2012-03-06 11:05:00 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-03-06 11:05:00 -0800 |
commit | 4540b5b4ea2065c3e0d67b46bba8b6764801fbea (patch) | |
tree | 4e1561530b1b90ea497bac8e41d193fa605e98b4 /js/tools/OvalTool.js | |
parent | 4e35725e6c9044c37bef28b8c8d36f4b5c89bfd9 (diff) | |
parent | 84332ab81c1b445195f1d9be8bbeae0725c8e758 (diff) | |
download | ninja-4540b5b4ea2065c3e0d67b46bba8b6764801fbea.tar.gz |
Merge branch 'refs/heads/master' into panels
Diffstat (limited to 'js/tools/OvalTool.js')
-rwxr-xr-x | js/tools/OvalTool.js | 9 |
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 | ||
11 | var Circle = require("js/lib/geom/circle").Circle; | ||
12 | var MaterialsModel = require("js/models/materials-model").MaterialsModel; | ||
13 | |||
11 | exports.OvalTool = Montage.create(ShapeTool, { | 14 | exports.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); |