flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bigosma...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Handle case where fill could be a LinearGradient or a SolidColor
Date Wed, 30 Sep 2015 08:50:59 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 28c5972bb -> 3c8b08728


Handle case where fill could be a LinearGradient or a SolidColor


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3c8b0872
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3c8b0872
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3c8b0872

Branch: refs/heads/develop
Commit: 3c8b087281c79af445de51ec3e8c3dfac660ac19
Parents: 28c5972
Author: OmPrakash Muppirala <bigosmallm@gmail.com>
Authored: Wed Sep 30 10:48:21 2015 +0200
Committer: OmPrakash Muppirala <bigosmallm@gmail.com>
Committed: Wed Sep 30 10:48:47 2015 +0200

----------------------------------------------------------------------
 .../charts/supportClasses/BoxItemRenderer.as    | 22 ++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c8b0872/frameworks/projects/Charts/asjs/src/org/apache/flex/charts/supportClasses/BoxItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/asjs/src/org/apache/flex/charts/supportClasses/BoxItemRenderer.as
b/frameworks/projects/Charts/asjs/src/org/apache/flex/charts/supportClasses/BoxItemRenderer.as
index 1bec3b1..f94bf84 100644
--- a/frameworks/projects/Charts/asjs/src/org/apache/flex/charts/supportClasses/BoxItemRenderer.as
+++ b/frameworks/projects/Charts/asjs/src/org/apache/flex/charts/supportClasses/BoxItemRenderer.as
@@ -25,6 +25,7 @@ package org.apache.flex.charts.supportClasses
 	import org.apache.flex.core.graphics.IStroke;
 	import org.apache.flex.core.graphics.Rect;
 	import org.apache.flex.core.graphics.SolidColor;
+	import org.apache.flex.core.graphics.LinearGradient;
 	import org.apache.flex.html.supportClasses.DataItemRenderer;
 	
 	/**
@@ -230,7 +231,7 @@ package org.apache.flex.charts.supportClasses
 			}
 		}
 		
-		private var hoverFill:SolidColor;
+		private var hoverFill:IFill;
 		
 		override public function updateRenderer():void
 		{
@@ -238,9 +239,22 @@ package org.apache.flex.charts.supportClasses
 			
 			if (down||selected||hovered) {
 				if (hoverFill == null) {
-					hoverFill = new SolidColor();
-					hoverFill.color = (fill as SolidColor).color;
-					hoverFill.alpha = 0.5;
+					if(fill is SolidColor)
+					{
+						hoverFill = new SolidColor();
+						(hoverFill as SolidColor).color = (fill as SolidColor).color;
+						(hoverFill as SolidColor).alpha = 0.5;
+					}
+					else if(fill is LinearGradient)
+					{
+						hoverFill = new LinearGradient();
+						(hoverFill as LinearGradient).entries = (fill as LinearGradient).entries;
+						for (var i:int=0; i<(hoverFill as LinearGradient).entries; i++)
+						{
+							(hoverFill as LinearGradient).entries[i].alpha = 0.5;
+						}
+					}
+					
 				}
 				filledRect.fill = hoverFill;
 			}


Mime
View raw message