From 830b011d94d728882286d72e129f7405134957c7 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 1 Feb 2012 17:05:07 -0800 Subject: Updated color code in the PI to go through element mediator. Signed-off-by: Nivesh Rajbhandari --- js/tools/OvalTool.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'js/tools/OvalTool.js') diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index e0f1f03f..2fa5411b 100644 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js @@ -75,6 +75,14 @@ exports.OvalTool = Montage.create(ShapeTool, { canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; canvas.elementModel.shapeModel.stroke = strokeColor; canvas.elementModel.shapeModel.fill = fillColor; + if(strokeColor) + { + canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke; + } + if(fillColor) + { + canvas.elementModel.shapeModel.background = this.application.ninja.colorController.colorToolbar.fill; + } canvas.elementModel.shapeModel.innerRadius = this.options.innerRadius.value + " " + this.options.innerRadius.units; -- cgit v1.2.3 From 486d9a31a85dd833a1c798049a00403756703034 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 6 Feb 2012 11:35:49 -0800 Subject: Support use WebGL checkbox in the PI. Signed-off-by: Nivesh Rajbhandari --- js/tools/OvalTool.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/tools/OvalTool.js') diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index 2fa5411b..446c6754 100644 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js @@ -95,6 +95,7 @@ exports.OvalTool = Montage.create(ShapeTool, { canvas.elementModel.shapeModel.strokeStyle = strokeStyle; canvas.elementModel.shapeModel.GLGeomObj = oval; + canvas.elementModel.shapeModel.useWebGl = this.options.use3D; } else { -- cgit v1.2.3 From 486842239c71e7964f38a09aacda4970f2a82e1a Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 7 Feb 2012 10:58:14 -0800 Subject: 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 --- js/tools/OvalTool.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'js/tools/OvalTool.js') 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, { var strokeMaterial = null; var fillMaterial = null; - var strokeIndex = parseInt(this.options.strokeMaterial); - if(strokeIndex > 0) + var strokeM = this.options.strokeMaterial; + if(strokeM) { - strokeMaterial = Object.create(MaterialsLibrary.getMaterialAt(strokeIndex-1)); + strokeMaterial = Object.create(MaterialsLibrary.getMaterial(strokeM)); } - var fillIndex = parseInt(this.options.fillMaterial); - if(fillIndex > 0) + var fillM = this.options.fillMaterial; + if(fillM) { - fillMaterial = Object.create(MaterialsLibrary.getMaterialAt(fillIndex-1)); + fillMaterial = Object.create(MaterialsLibrary.getMaterial(fillM)); } @@ -88,8 +88,6 @@ exports.OvalTool = Montage.create(ShapeTool, { canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; canvas.elementModel.shapeModel.fillMaterial = fillMaterial; - canvas.elementModel.shapeModel.strokeMaterialIndex = strokeIndex; - canvas.elementModel.shapeModel.fillMaterialIndex = fillIndex; canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; canvas.elementModel.shapeModel.strokeStyle = strokeStyle; -- cgit v1.2.3