Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8164247

Slider: irregular ticks sometimes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4
    • tbd
    • 9
    • javafx

    Description

      please run the following test code:

      import javafx.application.Application;
      import javafx.scene.*;
      import javafx.scene.control.Slider;
      import javafx.stage.Stage;
      import javafx.geometry.Insets;

      public class SliderTest extends Application {

          @Override
          public void start(Stage stage) {

              Group root = new Group();
              Scene scene = new Scene(root, 200, 150);
              stage.setScene(scene);

              Slider s = new Slider(-2., 2., 0.25);
              s.setPadding(new Insets(20, 20, 20, 20));

              s.setShowTickLabels(true);
              s.setShowTickMarks(true);
              s.setMajorTickUnit(0.5);
              s.setMinorTickCount(10);

              root.getChildren().add(s);
              stage.show();
          }

          public static void main(String[] args) { launch(args); }
      }

      when running with JDK9 b129 (Windows 7), it produces irregular major tick step (1 for the negative values and 0.5 for positive) - please see "scale-nok.png"

      no such issue when running with JDK8 b132 on the same machine ("scale-ok.png") - probably a regression?

      the behavior for JDK8 looks more reasonable - ignore the ticks if they could not be rendered regularly.

      Attachments

        1. nok-2.png
          nok-2.png
          4 kB
        2. scale-nok.png
          scale-nok.png
          3 kB
        3. scale-ok.png
          scale-ok.png
          3 kB

        Activity

          People

            Unassigned Unassigned
            avstepan Alexander Stepanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: