royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-asjs] 04/04: axis labels are working
Date Fri, 02 Nov 2018 20:44:49 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 077ede82212e1fd8295cbf42da517b68645477b4
Author: Alex Harui <aharui@apache.org>
AuthorDate: Fri Nov 2 13:43:55 2018 -0700

    axis labels are working
---
 .../src/main/royale/mx/charts/AxisRenderer.as      | 36 +++++++++++++++++++++-
 .../src/main/royale/mx/charts/GridLines.as         |  8 +++++
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/AxisRenderer.as b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/AxisRenderer.as
index a28b0ab..eede394 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/AxisRenderer.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/AxisRenderer.as
@@ -1349,7 +1349,8 @@ public class AxisRenderer extends DualStyleObject implements IAxisRenderer
             var oldX:Number = x - unscaledHeight;
             super.setActualSize(h, w);
             move(oldX + w, y);
-        }       
+        }
+        updateDisplayList(w, h);
     }
 
     /**
@@ -3346,6 +3347,7 @@ public class AxisRenderer extends DualStyleObject implements IAxisRenderer
                 }
             }
             
+            graphics.beginStroke();
             graphics.moveTo(_gutters.left - leftJoin,
                             baseline + w / 2);
 
@@ -3353,6 +3355,7 @@ public class AxisRenderer extends DualStyleObject implements IAxisRenderer
 			
             graphics.lineTo(unscaledWidth - _gutters.right + rightJoin,
                             baseline + w / 2);
+            graphics.endStroke();
         }
     }
     
@@ -3443,8 +3446,10 @@ public class AxisRenderer extends DualStyleObject implements IAxisRenderer
             for (var i:int = 0; i < n; i++)
             {
                 left = axisStart + axisLength * _ticks[i];
+                g.beginStroke();
                 g.moveTo(left, tickStart);
                 g.lineTo(left, tickEnd);
+                g.endStroke();
             }
 
         }   
@@ -3509,8 +3514,10 @@ public class AxisRenderer extends DualStyleObject implements IAxisRenderer
             for (i = 0; i < n; i++)
             {
                 left = axisStart + axisLength * minorTicks[i];
+                g.beginStroke();
                 g.moveTo(left, tickStart);
                 g.lineTo(left, tickEnd);
+                g.endStroke();
             }
         }
 
@@ -3606,6 +3613,17 @@ public class AxisRenderer extends DualStyleObject implements IAxisRenderer
             {
                 measuringField = IUITextField(/*createInFontContext(UITextField)*/ new UITextField);
                 _measuringField = UIComponent(measuringField);
+                COMPILE::JS
+                {
+                    document.body.appendChild(_measuringField.element);
+                    _measuringField.element.style.width="auto";
+                    _measuringField.element.style.height="auto";
+                    _measuringField.element.style.position="absolute";
+                }
+            }
+            COMPILE::JS
+            {
+                _measuringField.element.style.display="block";
             }
             
             COMPILE::SWF
@@ -3748,6 +3766,10 @@ public class AxisRenderer extends DualStyleObject implements IAxisRenderer
 
         _supressInvalidations--;
 
+        COMPILE::JS
+        {
+            _measuringField.element.style.display="none";                
+        }
         return newLabelData.accurate == true;
     }
     
@@ -3883,6 +3905,18 @@ public class AxisRenderer extends DualStyleObject implements IAxisRenderer
     {
         AxisBase(_axis).highlightElements(true);
     }
+    
+    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/GridLines.as b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/GridLines.as
index aac294f..7130058 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/charts/GridLines.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/charts/GridLines.as
@@ -522,9 +522,11 @@ public class GridLines extends ChartElement
 					if (addedLastLine && idx == (spacing.length-1))
 						continue;
 
+                    g.beginStroke();
 					stroke.apply(g,null,null);
 					g.moveTo(rc.left, rc.bottom);
 					g.lineTo(rc.right, rc.bottom);
+                    g.endStroke();
 
 				}
 			}
@@ -610,9 +612,11 @@ public class GridLines extends ChartElement
 					if (addedLastLine && i == spacing.length-1)
 						continue;
 						
+                    g.beginStroke();
 					stroke.apply(g,null,null);
 					g.moveTo(rc.left, rc.top);
 					g.lineTo(rc.left, rc.bottom);
+                    g.endStroke();
 				}
 			}
 		}
@@ -631,18 +635,22 @@ public class GridLines extends ChartElement
 				cache[0].y > 0 && cache[0].y < unscaledHeight)
 			{
 				originStroke = getStyle("horizontalOriginStroke");
+                g.beginStroke();
 				originStroke.apply(g,null,null);
 				g.moveTo(0, cache[0].y - sWidth / 2);
 				g.lineTo(unscaledWidth/*$width*/, cache[0].y - sWidth / 2);
+                g.endStroke();
 			}
 
 			if (verticalShowOrigin &&
 				cache[0].x > 0 && cache[0].x < unscaledWidth)
 			{
 				originStroke = getStyle("verticalOriginStroke");
+                g.beginStroke();
 				originStroke.apply(g,null,null);
 				g.moveTo(cache[0].x - sWidth / 2, 0);
 				g.lineTo(cache[0].x - sWidth / 2, unscaledHeight/*$height*/);
+                g.endStroke();
 			}
 		}
 	}	


Mime
View raw message