From 321aba14c3f25506a3ffeabb06dc2448269f9b53 Mon Sep 17 00:00:00 2001 From: TadejZupancic Date: Fri, 15 Jun 2018 14:31:44 +0200 Subject: [PATCH] Update Graphics.js --- src/gameobjects/graphics/Graphics.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/gameobjects/graphics/Graphics.js b/src/gameobjects/graphics/Graphics.js index 49cf256a3..7135b8729 100644 --- a/src/gameobjects/graphics/Graphics.js +++ b/src/gameobjects/graphics/Graphics.js @@ -568,15 +568,20 @@ var Graphics = new Class({ */ fillRoundedRect: function (x, y, width, height, radius) { - if (typeof radius === 'number') { + if (typeof radius === 'number') + { radius = {tl: radius, tr: radius, br: radius, bl: radius}; - } else if (typeof radius === 'object') { + } + else if (typeof radius === 'object') + { var defaultRadius = {tl: 0, tr: 0, br: 0, bl: 0}; - for (var side in defaultRadius) { + for (var side in defaultRadius) + { radius[side] = radius[side] || defaultRadius[side]; } } - else { + else + { radius = {tl: 20, tr: 20, br: 20, bl: 20}; } @@ -615,15 +620,20 @@ var Graphics = new Class({ */ strokeRoundedRect: function (x, y, width, height, radius) { - if (typeof radius === 'number') { + if (typeof radius === 'number') + { radius = {tl: radius, tr: radius, br: radius, bl: radius}; - } else if (typeof radius === 'object') { + } + else if (typeof radius === 'object') + { var defaultRadius = {tl: 0, tr: 0, br: 0, bl: 0}; - for (var side in defaultRadius) { + for (var side in defaultRadius) + { radius[side] = radius[side] || defaultRadius[side]; } } - else { + else + { radius = {tl: 20, tr: 20, br: 20, bl: 20}; }