Browse Source

REPORT-99485 修复模版tab组件鼠标移动报错

newui
vito 1 year ago
parent
commit
598c6ee255
  1. 6
      designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java

6
designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java

@ -486,7 +486,7 @@ public class MultiTemplateTabPane extends JPanel {
startX = new int[maxPaintIndex - minPaintIndex + 1];
double templateStartX = scale(LEADING_WIDTH);
for (int i = getViewRange().getFirst(); i <= getViewRange().getSecond(); i++) {
int closePosition = (int) templateStartX + getTabWidth() - clodeIcon.getIconWidth() - GAP;
int closePosition = (int) templateStartX + getTabWidth() - clodeIcon.getIconWidth() - GAP;
startX[i - minPaintIndex] = closePosition;
templateStartX += getTabWidth();
}
@ -922,7 +922,9 @@ public class MultiTemplateTabPane extends JPanel {
public void mouseMoved(MouseEvent e) {
int evtX = e.getX();
mouseOveredIndex = getTemplateIndex(evtX);
setToolTipText(openedTemplate.get(mouseOveredIndex).getEditingFILE().getName());
if (mouseOveredIndex > -1) {
setToolTipText(openedTemplate.get(mouseOveredIndex).getEditingFILE().getName());
}
hoverMoreAction = isOverListDown(evtX);
closeIconIndex = isOverCloseIcon(evtX) ? mouseOveredIndex : -1;
MultiTemplateTabPane.this.repaint();

Loading…
Cancel
Save