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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • jfx19
    • Affects Version/s: jfx17
    • Component/s: javafx
    • None

      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);

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

              Created:
              Updated:
              Resolved: