File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -784,12 +784,12 @@ Phaser.BitmapData.prototype = {
784784 * @return {Phaser.BitmapData } This BitmapData object for method chaining.
785785 */
786786 setHSL : function ( h , s , l , region ) {
787+
788+ var bHaveH = h || h === 0 ;
789+ var bHaveS = s || s === 0 ;
790+ var bHaveL = l || l === 0 ;
787791
788- if ( h === undefined || h === null ) { h = false ; }
789- if ( s === undefined || s === null ) { s = false ; }
790- if ( l === undefined || l === null ) { l = false ; }
791-
792- if ( ! h && ! s && ! l )
792+ if ( ! bHaveH && ! bHaveS && ! bHaveL )
793793 {
794794 return ;
795795 }
@@ -807,17 +807,17 @@ Phaser.BitmapData.prototype = {
807807 {
808808 Phaser . Color . unpackPixel ( this . getPixel32 ( x , y ) , pixel , true ) ;
809809
810- if ( h )
810+ if ( bHaveH )
811811 {
812812 pixel . h = h ;
813813 }
814814
815- if ( s )
815+ if ( bHaveS )
816816 {
817817 pixel . s = s ;
818818 }
819819
820- if ( l )
820+ if ( bHaveL )
821821 {
822822 pixel . l = l ;
823823 }
You can’t perform that action at this time.
0 commit comments