diff options
author | Nivesh Rajbhandari | 2012-02-07 10:58:14 -0800 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-02-07 10:58:14 -0800 |
commit | 486842239c71e7964f38a09aacda4970f2a82e1a (patch) | |
tree | 20a6688d296b1ef09bf32add9dfdef586bfe4207 /js/tools/OvalTool.js | |
parent | 789eaf5a92c903f27462c69a8890fbec695ab14e (diff) | |
download | ninja-486842239c71e7964f38a09aacda4970f2a82e1a.tar.gz |
Updated tools and PI to get/set materials by binding to appModel's materials property. This requires us to add FlatMaterial to the list of materials in the MaterialsLibrary.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/tools/OvalTool.js')
-rw-r--r-- | js/tools/OvalTool.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index 446c6754..14655312 100644 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js | |||
@@ -43,16 +43,16 @@ exports.OvalTool = Montage.create(ShapeTool, { | |||
43 | var strokeMaterial = null; | 43 | var strokeMaterial = null; |
44 | var fillMaterial = null; | 44 | var fillMaterial = null; |
45 | 45 | ||
46 | var strokeIndex = parseInt(this.options.strokeMaterial); | 46 | var strokeM = this.options.strokeMaterial; |
47 | if(strokeIndex > 0) | 47 | if(strokeM) |
48 | { | 48 | { |
49 | strokeMaterial = Object.create(MaterialsLibrary.getMaterialAt(strokeIndex-1)); | 49 | strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); |
50 | } | 50 | } |
51 | 51 | ||
52 | var fillIndex = parseInt(this.options.fillMaterial); | 52 | var fillM = this.options.fillMaterial; |
53 | if(fillIndex > 0) | 53 | if(fillM) |
54 | { | 54 | { |
55 | fillMaterial = Object.create(MaterialsLibrary.getMaterialAt(fillIndex-1)); | 55 | fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM)); |
56 | } | 56 | } |
57 | 57 | ||
58 | 58 | ||
@@ -88,8 +88,6 @@ exports.OvalTool = Montage.create(ShapeTool, { | |||
88 | 88 | ||
89 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; | 89 | canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; |
90 | canvas.elementModel.shapeModel.fillMaterial = fillMaterial; | 90 | canvas.elementModel.shapeModel.fillMaterial = fillMaterial; |
91 | canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex; | ||
92 | canvas.elementModel.shapeModel.fillMaterialIndex = fillIndex; | ||
93 | 91 | ||
94 | canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; | 92 | canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; |
95 | canvas.elementModel.shapeModel.strokeStyle = strokeStyle; | 93 | canvas.elementModel.shapeModel.strokeStyle = strokeStyle; |