You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/11/01 21:50:14 UTC

[royale-asjs] branch develop updated (bb3c54d -> b3dc0b3)

This is an automated email from the ASF dual-hosted git repository.

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


    from bb3c54d  Merge pull request #335 from ajwfrost/ajwfrost/externalinterface
     new 8daa0ee  diagnostics
     new dba1bea  a way for ProgrammaticSkins to force a redraw
     new b97190c  handle lines vs files properly
     new b3dc0b3  line and area chart rendering.  May need to move top/left code to UIComponent so that all UIComponents default to positioning at 0,0 like they do in Flash

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../mx/charts/chartClasses/CartesianChart.as       | 50 ++++++++++++-
 .../royale/mx/charts/chartClasses/ChartBase.as     | 46 ++++++++++++
 .../royale/mx/charts/chartClasses/ChartElement.as  |  4 +
 .../royale/mx/charts/renderers/AreaRenderer.as     | 22 ++++++
 .../royale/mx/charts/renderers/LineRenderer.as     | 22 ++++++
 .../src/main/royale/mx/charts/series/AreaSeries.as | 85 +++++++++++++++-------
 .../src/main/royale/mx/charts/series/LineSeries.as | 42 +++++++----
 .../src/main/royale/mx/core/UIComponent.as         |  7 +-
 .../src/main/royale/mx/display/Graphics.as         | 29 +++++++-
 .../src/main/royale/mx/skins/ProgrammaticSkin.as   |  2 +-
 10 files changed, 262 insertions(+), 47 deletions(-)


[royale-asjs] 03/04: handle lines vs files properly

Posted by ah...@apache.org.
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 b97190c51f3cd2111c5d7ece491f08c9a289ddb7
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Nov 1 14:48:23 2018 -0700

    handle lines vs files properly
---
 .../src/main/royale/mx/display/Graphics.as         | 29 +++++++++++++++++++---
 1 file changed, 25 insertions(+), 4 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/display/Graphics.as b/frameworks/projects/MXRoyale/src/main/royale/mx/display/Graphics.as
index 06cbf85..74c2729 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/display/Graphics.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/display/Graphics.as
@@ -45,11 +45,14 @@ package mx.display
         COMPILE::JS
         private var svg:HTMLElement;
         
+        private var fillInProgress:Boolean;
+        
         /**
          * @royaleignorecoercion HTMLElement
          */
         public function clear():void
         {
+            fillInProgress = false;
             COMPILE::SWF
             {
                 displayObject.graphics.clear();
@@ -59,6 +62,8 @@ package mx.display
                 if (svg)
                     element.removeChild(svg);
                 svg = document.createElementNS("http://www.w3.org/2000/svg", "svg") as HTMLElement;
+                svg.setAttribute("width", displayObject.width.toString() + "px");
+                svg.setAttribute("height", displayObject.height.toString() + "px");
                 element.appendChild(svg);
             }
         }
@@ -80,6 +85,7 @@ package mx.display
                 fillColor = color;
                 fillAlpha = alpha;
             }
+            fillInProgress = true;
         }
         
         /**
@@ -113,6 +119,7 @@ package mx.display
                     pathParts = null;
                 }
             }
+            fillInProgress = false;
 		}
 		
         /**
@@ -132,11 +139,15 @@ package mx.display
          */
         public function endStroke(): void
         {
+            // sometimes GraphicsUtilities.PolyLine is called to set a path for a fill
+            // and not just draw a line
+            if (fillInProgress) return;
+            
             COMPILE::JS
             {
                 if (pathParts && pathParts.length)
                 {
-                    var path:SVGElement = document.createElementNS("http://www.w3.org/2000/svg", "path") as SVGElement;
+                    var path:SVGElement = document.createElementNS("http://www.w3.org/2000/svg", "polyline") as SVGElement;
                     var colorString:String = "RGB(" + (color >> 16) + "," + ((color & 0xff00) >> 8) + "," + (color & 0xff) + ")";
                     path.setAttribute("stroke", colorString);
                     var widthString:String = thickness.toString();
@@ -144,11 +155,21 @@ package mx.display
                     if (alpha != 1)
                         path.setAttribute("stroke-opacity", alpha.toString());
                     //colorString = "RGB(" + (fillColor >> 16) + "," + ((fillColor & 0xff00) >> 8) + "," + (fillColor & 0xff) + ")";
-                    //path.setAttribute("fill", colorString);
+                    path.setAttribute("fill", "none");
                     //if (fillAlpha != 1)
                     //    path.setAttribute("fill-opacity", fillAlpha.toString());
-                    var pathString:String = pathParts.join(" ");
-                    path.setAttribute("d", pathString);
+                    var pathString:String = "";
+                    var firstOne:Boolean = true;
+                    var n:int = pathParts.length;
+                    for (var i:int = 0;i < n; i++)
+                    {
+                        var part:String = pathParts[i];
+                        if (!firstOne)
+                            pathString += ",";
+                        firstOne = false;
+                        pathString += part.substring(1);
+                    }
+                    path.setAttribute("points", pathString);
                     path.setAttribute("pointer-events", "none");
                     svg.appendChild(path);
                     pathParts = null;


[royale-asjs] 01/04: diagnostics

Posted by ah...@apache.org.
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 8daa0ee61eabae84aba75d2e55f4a093905f8ff1
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Nov 1 14:46:28 2018 -0700

    diagnostics
---
 .../mx/charts/chartClasses/CartesianChart.as       | 50 +++++++++++++++++++++-
 .../royale/mx/charts/chartClasses/ChartBase.as     | 46 ++++++++++++++++++++
 2 files changed, 95 insertions(+), 1 deletion(-)

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 698e554..67c8f4d 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
@@ -19,6 +19,10 @@
 
 package mx.charts.chartClasses
 {
+COMPILE::JS
+{
+    import goog.DEBUG;
+}
 
 import org.apache.royale.events.Event;
 import mx.events.KeyboardEvent;
@@ -853,10 +857,34 @@ public class CartesianChart extends ChartBase
             var addIndex:int = dataTipLayerIndex - 1;
             
             if (_horizontalAxisRenderer)
+            {
+                COMPILE::JS
+                {
+                    if (goog.DEBUG)
+                        if (id)
+                            UIComponent(_horizontalAxisRenderer).id = id + "_horizontalAxisRenderer";
+                }
                 addChild(UIComponent(_horizontalAxisRenderer));
+                COMPILE::JS
+                {
+                    UIComponent(_horizontalAxisRenderer).element.style.position = "absolute";                        
+                }
+            }
             
             if (_verticalAxisRenderer)
+            {
+                COMPILE::JS
+                {
+                    if (goog.DEBUG)
+                        if (id)
+                            UIComponent(_verticalAxisRenderer).id = id + "_verticalAxisRenderer";
+                }
                 addChild(UIComponent(_verticalAxisRenderer));
+                COMPILE::JS
+                {
+                    UIComponent(_verticalAxisRenderer).element.style.position = "absolute";
+                }
+            }
 
             invalidateDisplayList();
 
@@ -1970,13 +1998,33 @@ public class CartesianChart extends ChartBase
         var n:uint = _horizontalAxisRenderers.length;                    
         for (var i:int = 0; i < n; i++)
         {
+            COMPILE::JS
+            {
+                if (goog.DEBUG)
+                    if (id)
+                        UIComponent(_horizontalAxisRenderers[i]).id = id + "_horizontalAxisRenderers" + i.toString();
+            }
             addChild(UIComponent(_horizontalAxisRenderers[i]));
-        }
+            COMPILE::JS
+            {
+                UIComponent(_horizontalAxisRenderers[i]).element.style.position = "absolute";
+            }
+       }
         
         n = _verticalAxisRenderers.length;
         for (i = 0; i < n; i++)
         {
+            COMPILE::JS
+            {
+                if (goog.DEBUG)
+                    if (id)
+                        UIComponent(_verticalAxisRenderers[i]).id = id + "_verticalAxisRenderer" + i.toString();
+            }
             addChild(UIComponent(_verticalAxisRenderers[i]));
+            COMPILE::JS
+            {
+                UIComponent(_verticalAxisRenderer[i]).element.style.position = "absolute";
+            }
         }
         adjustAxesPlacements();
                                 
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 0a3a5ff..ceb4e0d 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
@@ -20,6 +20,10 @@
 package mx.charts.chartClasses
 {
 
+COMPILE::JS
+{
+    import goog.DEBUG;
+}
 import mx.charts.ChartItem;
 import mx.charts.HitData;
 import mx.charts.events.ChartEvent;
@@ -572,23 +576,65 @@ public class ChartBase extends UIComponent implements IFocusManagerComponent
         tabEnabled = false;
 
         _seriesHolder = new UIComponent();
+        COMPILE::JS
+        {
+            if (goog.DEBUG)
+                _seriesHolder.name = "_seriesHolder";
+        }
         _seriesFilterer = new UIComponent();
+        
+        COMPILE::JS
+        {
+            if (goog.DEBUG)
+                _seriesFilterer.name = "_seriesHolder";
+        }
         _seriesHolder.addChild(_seriesFilterer);
         addChild(_seriesHolder);
+        COMPILE::JS
+        {
+            _seriesHolder.element.style.position = "absolute";
+            _seriesFilterer.element.style.position = "absolute";
+        }
 
         _backgroundElementHolder = new UIComponent();
+        COMPILE::JS
+        {
+            if (goog.DEBUG)
+                _backgroundElementHolder.name = "_backgroundElementHolder";
+        }
         addChild(_backgroundElementHolder);
+        COMPILE::JS
+        {
+            _backgroundElementHolder.element.style.position = "absolute";            
+        }
 
         _annotationElementHolder = new UIComponent();
+        COMPILE::JS
+        {
+            if (goog.DEBUG)
+                _annotationElementHolder.name = "_annotationElementHolder";
+        }
         addChild(_annotationElementHolder);
+        COMPILE::JS
+        {
+            _annotationElementHolder.element.style.position = "absolute";
+        }
         
         _dataTipOverlay = new UIComponent();
         _dataTipOverlay.name = "dataTipOverlay";
         addChild(_dataTipOverlay);
+        COMPILE::JS
+        {
+            _dataTipOverlay.element.style.position = "absolute";
+        }
         
         _allDataTipOverlay = new UIComponent();
         _allDataTipOverlay.name = "allDataTipOverlay";
         addChild(_allDataTipOverlay);
+        COMPILE::JS
+        {
+            _allDataTipOverlay.element.style.position = "absolute";
+        }
 
         var g:Graphics;
         


[royale-asjs] 04/04: line and area chart rendering. May need to move top/left code to UIComponent so that all UIComponents default to positioning at 0, 0 like they do in Flash

Posted by ah...@apache.org.
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 b3dc0b32301a5b778182f7f95908ec61b57236f6
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Nov 1 14:49:47 2018 -0700

    line and area chart rendering.  May need to move top/left code to UIComponent so that all UIComponents default to positioning at 0,0 like they do in Flash
---
 .../royale/mx/charts/chartClasses/ChartElement.as  |  4 +
 .../royale/mx/charts/renderers/AreaRenderer.as     | 22 ++++++
 .../royale/mx/charts/renderers/LineRenderer.as     | 22 ++++++
 .../src/main/royale/mx/charts/series/AreaSeries.as | 85 +++++++++++++++-------
 .../src/main/royale/mx/charts/series/LineSeries.as | 42 +++++++----
 5 files changed, 135 insertions(+), 40 deletions(-)

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 424e6e7..910d33b 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
@@ -668,6 +668,10 @@ public class ChartElement extends DualStyleObject implements IChartElement2
     override public function addedToParent():void
     {
         super.addedToParent();
+        COMPILE::JS
+        {
+            element.style.position = "absolute";
+        }
         commitProperties();
         measure();
         updateDisplayList(getExplicitOrMeasuredWidth(), getExplicitOrMeasuredHeight());
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/renderers/AreaRenderer.as b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/renderers/AreaRenderer.as
index ce61324..19960bf 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/renderers/AreaRenderer.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/renderers/AreaRenderer.as
@@ -29,6 +29,10 @@ import mx.graphics.IFill;
 import mx.graphics.IStroke;
 import mx.graphics.SolidColorStroke;
 import mx.skins.ProgrammaticSkin;
+COMPILE::JS
+{
+    import org.apache.royale.core.WrappedHTMLElement;
+}
 
 /**
  *  The default class used to render the area
@@ -76,6 +80,15 @@ public class AreaRenderer extends ProgrammaticSkin implements IDataRenderer
 		super();
 	}
 	
+    COMPILE::JS
+    override protected function createElement():WrappedHTMLElement
+    {
+        var element:WrappedHTMLElement = super.createElement();
+        positioner.style.left = "0px";
+        positioner.style.top = "0px";
+        return element;
+    }
+    
     //--------------------------------------------------------------------------
     //
     //  Properties
@@ -197,6 +210,15 @@ public class AreaRenderer extends ProgrammaticSkin implements IDataRenderer
 
 		g.endFill();
 	}
+    
+    override public function addedToParent():void
+    {
+        super.addedToParent();
+        COMPILE::JS
+            {
+                element.style.position = "absolute";
+            }
+    }
 }
 
 }
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/renderers/LineRenderer.as b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/renderers/LineRenderer.as
index 39b44ba..8852bd9 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/renderers/LineRenderer.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/renderers/LineRenderer.as
@@ -24,6 +24,10 @@ import mx.charts.chartClasses.GraphicsUtilities;
 import mx.core.IDataRenderer;
 import mx.graphics.IStroke;
 import mx.skins.ProgrammaticSkin;
+COMPILE::JS
+{
+    import org.apache.royale.core.WrappedHTMLElement;
+}
 
 /**
  *  A simple implementation of a line segment renderer
@@ -59,6 +63,15 @@ public class LineRenderer extends ProgrammaticSkin implements IDataRenderer
 	{
 		super();
 	}
+    
+    COMPILE::JS
+    override protected function createElement():WrappedHTMLElement
+    {
+        var element:WrappedHTMLElement = super.createElement();
+        positioner.style.left = "0px";
+        positioner.style.top = "0px";
+        return element;
+    }
 
     //--------------------------------------------------------------------------
     //
@@ -127,6 +140,15 @@ public class LineRenderer extends ProgrammaticSkin implements IDataRenderer
 									   stroke,form);
 
 	}
+    
+    override public function addedToParent():void
+    {
+        super.addedToParent();
+        COMPILE::JS
+        {
+            element.style.position = "absolute";
+        }
+    }
 }
 
 }
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/series/AreaSeries.as b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/series/AreaSeries.as
index f37c55c..f2cfa26 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/series/AreaSeries.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/series/AreaSeries.as
@@ -20,10 +20,6 @@
 package mx.charts.series
 {
 
-import mx.core.UIComponent;
-import org.apache.royale.geom.Point;
-import org.apache.royale.geom.Rectangle;
-
 import mx.charts.DateTimeAxis;
 import mx.charts.HitData;
 import mx.charts.chartClasses.BoundedValue;
@@ -49,11 +45,18 @@ import mx.core.IDataRenderer;
 import mx.core.IFactory;
 import mx.core.IFlexDisplayObject;
 import mx.core.IFlexModuleFactory;
+import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.graphics.IFill;
 import mx.graphics.IStroke;
 import mx.graphics.SolidColor;
 import mx.graphics.SolidColorStroke;
+import mx.skins.ProgrammaticSkin;
+
+import org.apache.royale.geom.Point;
+import org.apache.royale.geom.Rectangle;
+
+import mx.skins.ProgrammaticSkin;
 import mx.styles.CSSStyleDeclaration;
 import mx.styles.ISimpleStyleClient;
 
@@ -76,17 +79,6 @@ include "../styles/metadata/ItemRendererStyles.as"
 [Style(name="adjustedRadius", type="Number", format="Length", inherit="yes")]  
 
 
-/** 
- *  Sets the fill for the area. You can specify either an object implementing the 
- *  IFill interface, or a number representing a solid color value. You can also specify a solid fill using CSS.
- *  
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
-[Style(name="areaFill", type="mx.graphics.IFill", inherit="no")]
-
 /**
  *  The class that the series uses to represent the filled area on the chart. This class is instantiated once per series.
  *  Classes used as areaRenderers should implement the IFlexDisplayObject, ISimpleStyleClient, and IDataRenderer 
@@ -100,17 +92,6 @@ include "../styles/metadata/ItemRendererStyles.as"
  */
 [Style(name="areaRenderer", type="mx.core.IFactory", inherit="no")]
 
-/** 
- *  Sets the line style for the area.
- *  You use a Stroke object to define the stroke.
- *  You can specify the itemRenderer in MXML or using styles.  
- *  
- *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
- */
-[Style(name="areaStroke", type="mx.graphics.IStroke", inherit="no")]
 
 /**
  *  Specifies an Array of fill objects that define the fill for
@@ -424,6 +405,56 @@ public class AreaSeries extends Series implements IStackable2
     //--------------------------------------------------------------------------
     
     //-----------------------------------
+    // areaFill
+    //-----------------------------------
+        
+    /** 
+     *  Sets the fill for the area. You can specify either an object implementing the 
+     *  IFill interface, or a number representing a solid color value. You can also specify a solid fill using CSS.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get areaFill():mx.graphics.IFill
+    {
+        return getStyle("areaFill");
+    }
+    public function set areaFill(value:mx.graphics.IFill):void
+    {
+        setStyle("areaFill", value);
+        if (parent && areaStroke)
+            updateDisplayList(width, height);
+    }
+        
+    //-----------------------------------
+    // areaStroke
+    //-----------------------------------
+    
+    /** 
+     *  Sets the line style for the area.
+     *  You use a Stroke object to define the stroke.
+     *  You can specify the itemRenderer in MXML or using styles.  
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    [Style(name="areaStroke", type="mx.graphics.IStroke", inherit="no")]
+    public function get areaStroke():mx.graphics.IStroke
+    {
+        return getStyle("areaStroke");
+    }
+    public function set areaStroke(value:mx.graphics.IStroke):void
+    {
+        setStyle("areaStroke", value);
+        if (parent && areaFill)
+            updateDisplayList(width, height);
+    }
+    
+    //-----------------------------------
     // fillFunction
     //-----------------------------------
     [Bindable]
@@ -1026,6 +1057,8 @@ public class AreaSeries extends Series implements IStackable2
             _transition = false;
         }
 
+        if (_areaRenderer is ProgrammaticSkin)
+           (_areaRenderer as ProgrammaticSkin).invalidateDisplayList(); // some visual changes don't change the size
         _areaRenderer.setActualSize(unscaledWidth, unscaledHeight);
         
         (_areaRenderer as IDataRenderer).data = renderData;     
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/series/LineSeries.as b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/series/LineSeries.as
index 387ace1..32c1918 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/series/LineSeries.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/series/LineSeries.as
@@ -179,19 +179,6 @@ include "../styles/metadata/ItemRendererStyles.as"
 [Style(name="lineSegmentRenderer", type="mx.core.IFactory", inherit="no")]
 
 /** 
-  *  Sets the stroke for the actual line segments. 
-  *  The default value for a LineChart control is orange (<code>0xE48701</code>). 
-  *  The default color for a LineSeries used in a CartesianChart control is black (<code>0x000000</code>). 
-  *  The default value for the width is 3.
-  *  
-  *  @langversion 3.0
-  *  @playerversion Flash 9
-  *  @playerversion AIR 1.1
-  *  @productversion Flex 3
-  */
-[Style(name="lineStroke", type="mx.graphics.IStroke", inherit="no")]
-
-/** 
  *  Specifies the radius, in pixels, of the chart elements for the data points.
  *  This property applies only if you specify an item renderer
  *  using the <code>itemRenderer</code> property.  
@@ -654,10 +641,37 @@ public class LineSeries extends Series
         return LineSeriesSegment;
     }
 
+    
+    //----------------------------------
+    //  lineStroke
+    //----------------------------------
+    
+    /** 
+     *  Sets the stroke for the actual line segments. 
+     *  The default value for a LineChart control is orange (<code>0xE48701</code>). 
+     *  The default color for a LineSeries used in a CartesianChart control is black (<code>0x000000</code>). 
+     *  The default value for the width is 3.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get lineStroke():IStroke
+    {
+        return getStyle("lineStroke");
+    }
+    public function set lineStroke(value:IStroke):void
+    {
+        setStyle("lineStroke", value);
+        if (parent)
+            updateDisplayList(width, height);
+    }
+    
     //----------------------------------
     //  radius
     //----------------------------------
-
+    
     [Inspectable(category="Styles")]
 
     /** 


[royale-asjs] 02/04: a way for ProgrammaticSkins to force a redraw

Posted by ah...@apache.org.
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 dba1bea34c0e884632237ca0826034d92a8642cb
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Nov 1 14:47:45 2018 -0700

    a way for ProgrammaticSkins to force a redraw
---
 .../projects/MXRoyale/src/main/royale/mx/core/UIComponent.as       | 7 ++++++-
 .../projects/MXRoyale/src/main/royale/mx/skins/ProgrammaticSkin.as | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index 7404dd1..660a71b 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -461,6 +461,7 @@ public class UIComponent extends UIBase
     IFlexDisplayObject,
     IInvalidating,
     IStatesObject,
+    ISimpleStyleClient,
     IUIComponent, IVisualElement, IFlexModule
 {
     //--------------------------------------------------------------------------
@@ -3431,6 +3432,8 @@ COMPILE::JS
         trace("invalidateParentSizeAndDisplayList not implemented");
     }
 
+    protected var invalidateDisplayListFlag:Boolean = false;
+    
     /**
      *  Marks a component so that its <code>updateDisplayList()</code>
      *  method gets called during a later screen update.
@@ -3456,6 +3459,7 @@ COMPILE::JS
     public function invalidateDisplayList():void
     {
         trace("invalidateDisplayList not implemented");
+        invalidateDisplayListFlag = true;
     }
 
     /**
@@ -3959,7 +3963,8 @@ COMPILE::JS
     protected function updateDisplayList(unscaledWidth:Number,
                                         unscaledHeight:Number):void
     {
-        trace("updateDisplayList not implemented");                    
+        trace("updateDisplayList not implemented");  
+        invalidateDisplayListFlag = 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 6b50688..9dc0ac8 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/skins/ProgrammaticSkin.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/skins/ProgrammaticSkin.as
@@ -455,7 +455,7 @@ public class ProgrammaticSkin extends UIComponent
 		
         super.setActualSize(newWidth, newHeight);
         
-		if (changed)
+		if (changed || invalidateDisplayListFlag)
 			updateDisplayList(width, height); // was invalidateDisplayList
 	}