changeset 6896:19d520422ce9

Reverted accidentally commited code in: changeset: 6835:e391dce8d6d7 user: Martin Sladecek <martin.sladecek@oracle.com> date: Wed Apr 23 08:15:08 2014 +0200 summary: RT-29507 [Chart] axis rotate can be lost.
author Martin Sladecek <martin.sladecek@oracle.com>
date Fri, 25 Apr 2014 09:06:56 +0200
parents 2a9ac59e84eb
children 22f9eedec9dd
files modules/controls/src/main/java/javafx/scene/chart/Axis.java
diffstat 1 files changed, 12 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/chart/Axis.java	Fri Apr 25 08:14:52 2014 +0200
+++ b/modules/controls/src/main/java/javafx/scene/chart/Axis.java	Fri Apr 25 09:06:56 2014 +0200
@@ -875,24 +875,23 @@
      * @param side The side to place text next to position x,y at
      */
     private void positionTextNode(Text node, double posX, double posY, double angle, Side side) {
-        Bounds bounds = node.getLayoutBounds();
-        double tX, tY;
+        node.setLayoutX(0);
+        node.setLayoutY(0);
+        node.setRotate(angle);
+        final Bounds bounds = node.getBoundsInParent();
         if (Side.LEFT.equals(side)) {
-            tX = posX-bounds.getWidth()-bounds.getMinX();
-            tY = posY - (bounds.getHeight() / 2d) - bounds.getMinY();
+            node.setLayoutX(posX-bounds.getWidth()-bounds.getMinX());
+            node.setLayoutY(posY - (bounds.getHeight() / 2d) - bounds.getMinY());
         } else if (Side.RIGHT.equals(side)) {
-            tX = posX-bounds.getMinX();
-            tY = posY-(bounds.getHeight()/2d)-bounds.getMinY();
+            node.setLayoutX(posX-bounds.getMinX());
+            node.setLayoutY(posY-(bounds.getHeight()/2d)-bounds.getMinY());
         } else if (Side.TOP.equals(side)) {
-            tX = posX-(bounds.getWidth()/2d)-bounds.getMinX();
-            tY = posY-bounds.getHeight()-bounds.getMinY();
+            node.setLayoutX(posX-(bounds.getWidth()/2d)-bounds.getMinX());
+            node.setLayoutY(posY-bounds.getHeight()-bounds.getMinY());
         } else {
-            tX = posX-(bounds.getWidth()/2d)-bounds.getMinX();
-            tY = posY-bounds.getMinY();
+            node.setLayoutX(posX-(bounds.getWidth()/2d)-bounds.getMinX());
+            node.setLayoutY(posY-bounds.getMinY());
         }
-        node.getTransforms().setAll(
-                new Rotate(angle, tX + bounds.getWidth() + bounds.getHeight(), tY + bounds.getHeight()),
-                new Translate(tX, tY - bounds.getHeight()));
     }
 
     /**