int xShift = 0;
int yShift = 4;
for (int i = 0; i < tabs.size(); i++) {
TabBase tab = tabs.get(i);
if (!tab.isVisible() || tab.side == TabBase.RIGHT) {
continue;
}
tab.currentShiftX = xShift;
tab.currentShiftY = yShift;
if (tab.intersectsWith(mX, mY, xShift, yShift)) {
return tab;
}
yShift += tab.currentHeight;
}
xShift = xSize;
yShift = 4;
for (int i = 0; i < tabs.size(); i++) {
TabBase tab = tabs.get(i);
if (!tab.isVisible() || tab.side == TabBase.LEFT) {
continue;
}
tab.currentShiftX = xShift;
tab.currentShiftY = yShift;
if (tab.intersectsWith(mX, mY, xShift, yShift)) {
return tab;
}
yShift += tab.currentHeight;
}
return null;