Skip to content

Commit

Permalink
added support for RadialGradient
Browse files Browse the repository at this point in the history
  • Loading branch information
EliEladElrom committed Apr 19, 2010
1 parent 463be71 commit 68f3348
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions EladLibFlex/.actionScriptProperties
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
<modules/>
<buildCSSFiles/>
</actionScriptProperties>

1 change: 1 addition & 0 deletions EladLibFlex/.flexProperties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

Binary file modified EladLibFlex/bin-debug/FXGConverter.swf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package com.elad.framework.utils.fxgconverter

import mx.graphics.GradientEntry;
import mx.graphics.LinearGradient;
import mx.graphics.RadialGradient;
import mx.graphics.SolidColor;
import mx.graphics.SolidColorStroke;
import mx.utils.StringUtil;
Expand Down Expand Up @@ -83,8 +84,8 @@ package com.elad.framework.utils.fxgconverter
component = retrieveComponentFromXML( subSubComList[ii], debug );

// Use case for gradients
if ( component is LinearGradient )
(component as LinearGradient).entries = getGradients( subComList[i].children().children().children(), debug );;
if ( component is LinearGradient || component is RadialGradient )
component.entries = getGradients( subComList[i].children().children().children(), debug );;

addChildToComponent( component, previousComponent, debug );
}
Expand Down Expand Up @@ -171,7 +172,8 @@ package com.elad.framework.utils.fxgconverter
return false;
}

if ( child is SolidColor || ( child is LinearGradient && previousComponent is Path ) )
if ( child is SolidColor ||
( (child is LinearGradient || child is RadialGradient) && previousComponent is Path ) )
{
previousComponent.fill = child;
isUIComponent = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.elad.framework.utils.fxgconverter
import mx.controls.Label;
import mx.graphics.GradientEntry;
import mx.graphics.LinearGradient;
import mx.graphics.RadialGradient;
import mx.graphics.SolidColor;
import mx.graphics.SolidColorStroke;

Expand Down Expand Up @@ -45,7 +46,7 @@ package com.elad.framework.utils.fxgconverter
{
case "GradientEntry":
retComponent = new GradientEntry();
break;
break;
case "Group":
retComponent = new Group();
break;
Expand Down Expand Up @@ -91,6 +92,9 @@ package com.elad.framework.utils.fxgconverter
case "LinearGradient":
retComponent = new LinearGradient();
break;
case "RadialGradient":
retComponent = new RadialGradient();
break;
default:
if ( debug )
trace( "FAIL: missing component, couldn't parse component: " + componentType );
Expand Down

0 comments on commit 68f3348

Please sign in to comment.