Updated to use isNaN for alpha value testing, because the default value is 1 a value of 0 could not be set it would always fall back to 1. Also updated to use 1 as the default value in draw.
This commit is contained in:
parent
724b0e598b
commit
5696580ce6
@ -65,7 +65,7 @@ package com.degrafa.paint{
|
||||
* @see mx.graphics.Stroke
|
||||
**/
|
||||
public function get alpha():Number{
|
||||
if(!_alpha){return 1;}
|
||||
if(isNaN(_alpha)){return 1;}
|
||||
return _alpha;
|
||||
}
|
||||
public function set alpha(value:Number):void{
|
||||
@ -111,7 +111,8 @@ package com.degrafa.paint{
|
||||
public function begin(graphics:Graphics, rc:Rectangle):void{
|
||||
|
||||
//ensure that all defaults are in fact set these are temp until fully tested
|
||||
if(!_alpha){_alpha=0;}
|
||||
if(isNaN(_alpha)){_alpha=1;}
|
||||
|
||||
if(!_color){_color=0x000000;}
|
||||
|
||||
graphics.beginFill(color as uint,alpha);
|
||||
@ -133,7 +134,7 @@ package com.degrafa.paint{
|
||||
public function set derive(value:SolidFill):void{
|
||||
|
||||
if (!_color){_color = uint(value.color);}
|
||||
if (!_alpha){_alpha = value.alpha;}
|
||||
if (isNaN(_alpha)){_alpha = value.alpha;}
|
||||
|
||||
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ package com.degrafa.paint{
|
||||
* @see mx.graphics.Stroke
|
||||
**/
|
||||
public function get alpha():Number{
|
||||
if(!_alpha){return 1;}
|
||||
if(isNaN(_alpha)){return 1;}
|
||||
return _alpha;
|
||||
}
|
||||
public function set alpha(value:Number):void{
|
||||
@ -254,7 +254,7 @@ package com.degrafa.paint{
|
||||
public function apply(graphics:Graphics,rc:Rectangle):void{
|
||||
|
||||
//ensure that all defaults are in fact set these are temp until fully tested
|
||||
if(!_alpha){_alpha=0;}
|
||||
if(isNaN(_alpha)){_alpha=1;}
|
||||
if(!_color){_color=0x000000;}
|
||||
if(!_caps){_caps="round";}
|
||||
if(!_joints){_joints="round";}
|
||||
@ -273,7 +273,7 @@ package com.degrafa.paint{
|
||||
**/
|
||||
public function set derive(value:SolidStroke):void{
|
||||
|
||||
if (!_alpha){_alpha = value.alpha}
|
||||
if (isNaN(_alpha)){_alpha = value.alpha}
|
||||
if (!_caps){_caps = value.caps;}
|
||||
if (!_color){_color = uint(value.color);}
|
||||
if (!_joints){_joints = value.joints;}
|
||||
|
Loading…
Reference in New Issue
Block a user