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

Spinner with split horizontal arrows and a border places right arrow incorrectly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: openjfx17
    • Fix Version/s: openjfx19
    • Component/s: javafx
    • Labels:
      None

      Description

      When you have a Spinner with arrows split horizontally (Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL) and you also add a border around the control, the right arrow is not placed correctly. It is off several pixels to the left (the same as the border width).

      This is caused by a small bug in the layoutChildren code in SpinnerSkin. The position of the right arrow is determined without taking the value of "x" into account (which can be non-zero).

      Fix is trivial, replace:

                  // increment is on the right-hand side
                  incrementArrowButton.resize(widestArrowButton, h);
                  positionInArea(incrementArrowButton, w - widestArrowButton, y,
                          widestArrowButton, h, 0, HPos.CENTER, VPos.CENTER);

      With:

                  // increment is on the right-hand side
                  incrementArrowButton.resize(widestArrowButton, h);
                  positionInArea(incrementArrowButton, x + w - widestArrowButton, y,
                          widestArrowButton, h, 0, HPos.CENTER, VPos.CENTER);

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jhendrikx John Hendrikx
              Reporter:
              jhendrikx John Hendrikx
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: