}
}
private int pointerSelect(int x, int y) {
int selectedIndex = -1;
Dimension elemSize = getElementSize(false);
y = y - getAbsoluteY();
x = x - getAbsoluteX();
if (fixedSelection < FIXED_NONE_BOUNDRY) {
if (orientation == VERTICAL) {
selectedIndex = y / (elemSize.getHeight() + itemGap);
} else {
selectedIndex = x / (elemSize.getWidth() + itemGap);
}
} else {
int numOfcomponents = getModel().getSize();
Rectangle pos = new Rectangle();
Style style = getStyle();
int width = getWidth() - style.getPadding(RIGHT) - style.getPadding(LEFT) - getSideGap();
if (isScrollableX()) {
width = Math.max(width, getPreferredSize().getWidth() - style.getPadding(RIGHT) - style.getPadding(LEFT) - getSideGap());
}
Dimension rendererSize = getElementSize(false);
Dimension selectedSize = getElementSize(true);
for (int i = 0; i < numOfcomponents; i++) {
calculateComponentPosition(i, width, pos, rendererSize, selectedSize, true);
if (pos.contains(x, y)) {
selectedIndex = i;
break;