You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2014/10/21 17:46:56 UTC

git commit: [flex-asjs] [refs/heads/develop] - Small modifications to the FlexJS chart axis code to have the elements have proper width and height values that Safari recognizes and other browsers ignore (or at least, work with).

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 861ca2b9a -> b48e30e57


Small modifications to the FlexJS chart axis code to have the <svg> elements have proper width and height values that Safari recognizes and other browsers ignore (or at least, work with).


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

Branch: refs/heads/develop
Commit: b48e30e577b36a17cb7870b9dedcaad683c4e523
Parents: 861ca2b
Author: Peter Ent <pe...@apache.org>
Authored: Tue Oct 21 11:46:53 2014 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Tue Oct 21 11:46:53 2014 -0400

----------------------------------------------------------------------
 .../src/org/apache/flex/charts/beads/AxisBaseBead.as        | 9 +++++++++
 .../apache/flex/charts/beads/VerticalCategoryAxisBead.as    | 4 ++--
 .../org/apache/flex/charts/beads/VerticalLinearAxisBead.as  | 5 +++--
 3 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b48e30e5/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/AxisBaseBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/AxisBaseBead.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/AxisBaseBead.as
index dc4c11c..3f4f5c7 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/AxisBaseBead.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/AxisBaseBead.as
@@ -125,6 +125,8 @@ package org.apache.flex.charts.beads
 			// set (x,y) before adding as element to set the location correctly
 			axisPath.x = originX;
 			axisPath.y = originY;
+			axisPath.width = 1+xoffset;
+			axisPath.height = 1+yoffset;
 			UIBase(strand).addElement(axisPath);
 			axisPath.stroke = axisStroke;
 			var pathLine:String = "M 0 0 l "+String(xoffset)+" "+String(yoffset);
@@ -134,12 +136,17 @@ package org.apache.flex.charts.beads
 		}
 		
 		private var tickPathString:String = null;
+		private var tickMaxWidth:Number = 0;
+		private var tickMaxHeight:Number = 0;
 		
 		protected function addTickMark(xpos:Number, ypos:Number, xoffset:Number, yoffset:Number):void
 		{
 			if (tickPathString == null) tickPathString = "";
 			tickPathString = tickPathString + " M "+String(xpos)+" "+String(ypos);
 			tickPathString = tickPathString + " l " + String(xoffset)+" "+String(yoffset);
+			
+			tickMaxWidth = Math.max(tickMaxWidth, xpos+xoffset);
+			tickMaxHeight= Math.max(tickMaxHeight, ypos+yoffset);
 		}
 		
 		protected function drawTickPath(originX:Number, originY:Number):void
@@ -148,6 +155,8 @@ package org.apache.flex.charts.beads
 			// set (x,y) before adding as element to set the location correctly
 			tickPath.x = originX;
 			tickPath.y = originY;
+			tickPath.width = tickMaxWidth;
+			tickPath.height = tickMaxHeight;
 			UIBase(strand).addElement(tickPath);
 			tickPath.stroke = tickStroke;
 			tickPath.drawPath( 0, 0, tickPathString );

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b48e30e5/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/VerticalCategoryAxisBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/VerticalCategoryAxisBead.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/VerticalCategoryAxisBead.as
index ebab6da..be405ad 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/VerticalCategoryAxisBead.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/VerticalCategoryAxisBead.as
@@ -172,14 +172,14 @@ package org.apache.flex.charts.beads
 				UIBase(strand).addElement(label);
 			
 				// add a tick mark
-				addTickMark(yAxisWidthOffset - 5 - originX, ypos + useHeight/2 - originY, 5, 0);
+				addTickMark(0, ypos + useHeight/2 - originY, 5, 0);
 				
 				ypos -= useHeight;
 			}
 
 			// draw the axis and tick marks
 			drawAxisPath(originX, originY, 0, UIBase(strand).height - xAxisOffset);
-			drawTickPath(originX, originY);
+			drawTickPath(originX-5, originY);
 		}
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b48e30e5/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/VerticalLinearAxisBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/VerticalLinearAxisBead.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/VerticalLinearAxisBead.as
index 8e8e183..aa98b89 100644
--- a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/VerticalLinearAxisBead.as
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/charts/beads/VerticalLinearAxisBead.as
@@ -220,7 +220,8 @@ package org.apache.flex.charts.beads
 				UIBase(strand).addElement(label);
 			
 				// add a tick mark, too.
-				addTickMark(xpos - 5 - originX, ypos - originY, 5, 0);
+				//addTickMark(xpos - 5 - originX, ypos - originY, 5, 0);
+				addTickMark(0, ypos-originY, 5, 0);
 				
 				ypos -= tickSpacing;
 				tickValue += tickStep;
@@ -228,7 +229,7 @@ package org.apache.flex.charts.beads
 			
 			// draw the axis and the tick marks
 			drawAxisPath(originX, originY, 0, useHeight);
-			drawTickPath(originX, originY);
+			drawTickPath(originX-5, originY);
 			
 		}