mirror of
https://github.com/photonstorm/phaser
synced 2024-11-28 15:41:37 +00:00
Update Graphics.js
This commit is contained in:
parent
9affc60037
commit
321aba14c3
1 changed files with 18 additions and 8 deletions
|
@ -568,15 +568,20 @@ var Graphics = new Class({
|
||||||
*/
|
*/
|
||||||
fillRoundedRect: function (x, y, width, height, radius)
|
fillRoundedRect: function (x, y, width, height, radius)
|
||||||
{
|
{
|
||||||
if (typeof radius === 'number') {
|
if (typeof radius === 'number')
|
||||||
|
{
|
||||||
radius = {tl: radius, tr: radius, br: radius, bl: radius};
|
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};
|
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];
|
radius[side] = radius[side] || defaultRadius[side];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
radius = {tl: 20, tr: 20, br: 20, bl: 20};
|
radius = {tl: 20, tr: 20, br: 20, bl: 20};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,15 +620,20 @@ var Graphics = new Class({
|
||||||
*/
|
*/
|
||||||
strokeRoundedRect: function (x, y, width, height, radius)
|
strokeRoundedRect: function (x, y, width, height, radius)
|
||||||
{
|
{
|
||||||
if (typeof radius === 'number') {
|
if (typeof radius === 'number')
|
||||||
|
{
|
||||||
radius = {tl: radius, tr: radius, br: radius, bl: radius};
|
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};
|
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];
|
radius[side] = radius[side] || defaultRadius[side];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
radius = {tl: 20, tr: 20, br: 20, bl: 20};
|
radius = {tl: 20, tr: 20, br: 20, bl: 20};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue