Update Graphics.js

This commit is contained in:
TadejZupancic 2018-06-15 14:31:44 +02:00 committed by GitHub
parent 9affc60037
commit 321aba14c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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};
}