From d7f5d6ffb39d55f2d4f4f366421571826df1e8bb Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 20 Jul 2012 11:54:04 -0700 Subject: If no material was defined, use Flat material when switching from 2d to WebGL shape. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'js/controllers/elements/shapes-controller.js') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 1d945066..6dabff47 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -841,10 +841,10 @@ exports.ShapesController = Montage.create(CanvasController, { child.strokeMat = "Linear Gradient"; } } - else if( (child.strokeMat === "Radial Gradient") || + else if( !child.strokeMat || (child.strokeMat === "Radial Gradient") || (child.strokeMat === "Linear Gradient") ) { - // Set Flat Material for children geometry if color has been changed to solid + // Set Flat Material for children geometry if no material defined or color has been changed to solid child.strokeMat = "Flat"; } } @@ -863,10 +863,10 @@ exports.ShapesController = Montage.create(CanvasController, { child.fillMat = "Linear Gradient"; } } - else if( (child.fillMat === "Radial Gradient") || + else if( !child.fillMat || (child.fillMat === "Radial Gradient") || (child.fillMat === "Linear Gradient") ) { - // Set Flat Material for children geometry if color has been changed to solid + // Set Flat Material for children geometry if no material defined or color has been changed to solid child.fillMat = "Flat"; } } -- cgit v1.2.3