From 648ee61ae84216d0236e0dbc211addc13b2cfa3a Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:52:06 -0700 Subject: Expand tabs --- js/tools/RectTool.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/tools/RectTool.js') diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js index babd623a..82db3c7a 100755 --- a/js/tools/RectTool.js +++ b/js/tools/RectTool.js @@ -28,9 +28,9 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -var Montage = require("montage/core/core").Montage, +var Montage = require("montage/core/core").Montage, ShapeTool = require("js/tools/ShapeTool").ShapeTool, - ShapesController = require("js/controllers/elements/shapes-controller").ShapesController; + ShapesController = require("js/controllers/elements/shapes-controller").ShapesController; var Rectangle = require("js/lib/geom/rectangle").Rectangle; var MaterialsModel = require("js/models/materials-model").MaterialsModel; @@ -63,7 +63,7 @@ exports.RectTool = Montage.create(ShapeTool, { _buttons: {enumerable: false,value: { hexinput: [] , lockbutton: []}}, RenderShape: { - value: function (w, h, planeMat, midPt, canvas) + value: function (w, h, planeMat, midPt, canvas) { if( (Math.floor(w) === 0) || (Math.floor(h) === 0) ) { -- cgit v1.2.3 From ac27d538af33ca8d67d3d88729f49c05793afda7 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 9 Jul 2012 11:43:36 -0700 Subject: PI, drawing and editing fixes for shapes and materials. IKNinja-1841 - Cannot change webgl shape with LinearGradient and RadialGradient to solid color. IKNINJA-1851 - Cannot draw webgl shapes with Linear/RadialGradient material. IKNINJA-1864 - PI doesn't update the color of shape if WebGL material switches to Flat. IKNINJA-1886 - Gradient edits not applied to WebGL Stage object. Signed-off-by: Nivesh Rajbhandari --- js/tools/RectTool.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'js/tools/RectTool.js') diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js index 6f0e65c7..0dfafe57 100755 --- a/js/tools/RectTool.js +++ b/js/tools/RectTool.js @@ -74,14 +74,22 @@ exports.RectTool = Montage.create(ShapeTool, { { strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); } - strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; + if (strokeMaterial && this.options.stroke.color && (strokeMaterial.gradientType === this.options.stroke.color.gradientMode)) { + strokeColor = {gradientMode:strokeMaterial.gradientType, color:this.options.stroke.color.stops}; + } else { + strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; + } fillM = this.options.fillMaterial; if(fillM) { fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); } - fillColor = ShapesController.getMaterialColor(fillM) || fillColor; + if (fillMaterial && this.options.fill.color && (fillMaterial.gradientType === this.options.fill.color.gradientMode)) { + fillColor = {gradientMode:fillMaterial.gradientType, color:this.options.fill.color.stops}; + } else { + fillColor = ShapesController.getMaterialColor(fillM) || fillColor; + } } var world = this.getGLWorld(canvas, this.options.use3D); -- cgit v1.2.3