royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-asjs] 09/09: get chart to finally draw something
Date Wed, 31 Oct 2018 22:27:44 GMT
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 6fe175f26d70436f3301343dc3e805804214e457
Author: Alex Harui <aharui@apache.org>
AuthorDate: Wed Oct 31 15:27:13 2018 -0700

    get chart to finally draw something
---
 .../main/royale/mx/charts/chartClasses/CartesianChart.as |  2 +-
 .../src/main/royale/mx/charts/chartClasses/ChartBase.as  | 12 +++++++++++-
 .../main/royale/mx/charts/chartClasses/ChartElement.as   | 14 ++++++++++++++
 .../src/main/royale/mx/charts/styles/HaloDefaults.as     |  1 +
 .../src/main/royale/mx/skins/ProgrammaticSkin.as         | 16 +++++++++-------
 5 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/CartesianChart.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/CartesianChart.as
index 6462bc7..698e554 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/CartesianChart.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/CartesianChart.as
@@ -1211,7 +1211,7 @@ public class CartesianChart extends ChartBase
         }
         else
         {
-            return seriesObject.getTransformState();
+            return (seriesObject as Series).getTransformState();
         }
     }
     
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/ChartBase.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/ChartBase.as
index d4aea2d..0a3a5ff 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/ChartBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/ChartBase.as
@@ -3187,7 +3187,7 @@ public class ChartBase extends UIComponent implements IFocusManagerComponent
      
     mx_internal function getSeriesTransformState(seriesObject:Object):Boolean
     {
-        return seriesObject.getTransformState();
+        return (seriesObject as Series).getTransformState();
     }
 
     /**
@@ -4179,6 +4179,8 @@ public class ChartBase extends UIComponent implements IFocusManagerComponent
     {
     }
 
+    private var doingValidation:Boolean;
+    
     /**
      *  Triggers a redraw of the chart.
      *  Call this method when you add or change
@@ -4193,6 +4195,14 @@ public class ChartBase extends UIComponent implements IFocusManagerComponent
     {
         _bDataDirty=true;
         invalidateProperties();
+        if (parent && !doingValidation)
+        {
+            doingValidation = true;
+            commitProperties();
+            measure();
+            updateDisplayList(width, height);
+            doingValidation = false;
+        }
     }
 
     /**
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/ChartElement.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/ChartElement.as
index 43d2d91..424e6e7 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/ChartElement.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/chartClasses/ChartElement.as
@@ -449,6 +449,12 @@ public class ChartElement extends DualStyleObject implements IChartElement2
         invalidateDisplayList();
         if (_dataTransform)
             _dataTransform.dataChanged();
+        if (parent)
+        {
+            commitProperties();
+            // I think setActualSize is called first
+            updateDisplayList(width, height);
+        }
     }
 
     /** 
@@ -658,6 +664,14 @@ public class ChartElement extends DualStyleObject implements IChartElement2
     
         dataChanged();
     }
+    
+    override public function addedToParent():void
+    {
+        super.addedToParent();
+        commitProperties();
+        measure();
+        updateDisplayList(getExplicitOrMeasuredWidth(), getExplicitOrMeasuredHeight());
+    }
 }
 
 }
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/styles/HaloDefaults.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/styles/HaloDefaults.as
index 3fea70c..7631413 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/styles/HaloDefaults.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/styles/HaloDefaults.as
@@ -163,6 +163,7 @@ public class HaloDefaults
 		if (!selector)
 		{
 			selector = new CSSStyleDeclaration();
+            selector.name = selectorName;
 			styleManager.setStyleDeclaration(selectorName, selector, false);
 		}
 
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/skins/ProgrammaticSkin.as b/frameworks/projects/MXRoyale/src/main/royale/mx/skins/ProgrammaticSkin.as
index 9945fc1..6b50688 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/skins/ProgrammaticSkin.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/skins/ProgrammaticSkin.as
@@ -437,25 +437,27 @@ public class ProgrammaticSkin extends UIComponent
 	 *  @playerversion AIR 1.1
 	 *  @productversion Royale 0.9.3
 	 */
-	/* public function setActualSize(newWidth:Number, newHeight:Number):void
+	override public function setActualSize(newWidth:Number, newHeight:Number):void
 	{
 		var changed:Boolean = false;
 		
-		if (_width != newWidth)
+		if (width != newWidth)
 		{
-			_width = newWidth;
+			//width = newWidth;
 			changed = true;
 		}
 
-		if (_height != newHeight)
+		if (height != newHeight)
 		{
-			_height = newHeight;
+			//height = newHeight;
 			changed = true;
 		}
 		
+        super.setActualSize(newWidth, newHeight);
+        
 		if (changed)
-			invalidateDisplayList();
-	} */
+			updateDisplayList(width, height); // was invalidateDisplayList
+	}
 
 	//--------------------------------------------------------------------------
 	//


Mime
View raw message