Skip to content

Commit

Permalink
Do not use default values if there is a value specified, even if it i…
Browse files Browse the repository at this point in the history
…s falsey
  • Loading branch information
NickH-nz committed Jul 3, 2018
1 parent ce165da commit 879d792
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ts/Objects/InputBox.ts
Expand Up @@ -13,8 +13,8 @@ module PhaserInput {
super(game, 0, 0);

this.bgColor = (inputOptions.backgroundColor) ? parseInt(inputOptions.backgroundColor.slice(1), 16) : 0xffffff;
this.borderRadius = inputOptions.borderRadius || 0;
this.borderWidth = inputOptions.borderWidth || 1;
this.borderRadius = inputOptions.borderRadius = (typeof inputOptions.borderRadius === 'number') ? inputOptions.borderRadius : 0;
this.borderWidth = inputOptions.borderWidth = (typeof inputOptions.borderWidth === 'number') ? inputOptions.borderWidth : 1;
this.borderColor = (inputOptions.borderColor) ? parseInt(inputOptions.borderColor.slice(1), 16) : 0x959595;
this.boxAlpha = inputOptions.fillAlpha;
this.padding = inputOptions.padding;
Expand Down

0 comments on commit 879d792

Please sign in to comment.