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