modules/controls/src/main/java/javafx/scene/chart/XYChart.java

Print this page

        

@@ -630,12 +630,12 @@
         if (!rangeValid) {
             rangeValid = true;
             if(getData() != null) updateAxisRange();
         }
         // snap top and left to pixels
-        top = snapPosition(top);
-        left = snapPosition(left);
+        top = snapPositionY(top);
+        left = snapPositionX(left);
         // get starting stuff
         final Axis<X> xa = getXAxis();
         final ObservableList<Axis.TickMark<X>> xaTickMarks = xa.getTickMarks();
         final Axis<Y> ya = getYAxis();
         final ObservableList<Axis.TickMark<Y>> yaTickMarks = ya.getTickMarks();

@@ -645,16 +645,16 @@
         double xAxisWidth = 0;
         double xAxisHeight = 30; // guess x axis height to start with
         double yAxisWidth = 0;
         double yAxisHeight = 0;
         for (int count=0; count<5; count ++) {
-            yAxisHeight = snapSize(height - xAxisHeight);
+            yAxisHeight = snapSizeY(height - xAxisHeight);
             if (yAxisHeight < 0) {
                 yAxisHeight = 0;
             }
             yAxisWidth = ya.prefWidth(yAxisHeight);
-            xAxisWidth = snapSize(width - yAxisWidth);
+            xAxisWidth = snapSizeX(width - yAxisWidth);
             if (xAxisWidth < 0) {
                 xAxisWidth = 0;
             }
             double newXAxisHeight = xa.prefHeight(xAxisWidth);
             if (newXAxisHeight == xAxisHeight) break;