From cddfe101f845eecda288c74ec00e0cae8c0e2844 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 26 Apr 2023 11:51:31 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-94999=20=20frm-tab=E6=A0=8F=E4=B8=8Efvs-?= =?UTF-8?q?tab=E6=A0=8F=E5=88=87=E6=8D=A2=E6=97=B6=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E8=B7=B3=E5=88=B0=E5=85=B6=E4=BB=96=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/file/MultiTemplateTabPane.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java index 9b4b57fc45..c2b340dff2 100644 --- a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java @@ -998,9 +998,12 @@ public class MultiTemplateTabPane extends JComponent { // selectIndex 没有变化,但是对应的模板已经变成了前一张模板 if (closeIconIndex == selectedIndex || isCloseCurrent) { // 如果当前关闭的模板在最右侧,那么预览上一个,防止数组越界 + // 关闭的模板是当前选中的模板时,需要重新计算下一个待展示的模板的index if (selectedIndex >= maxPaintIndex) { // selectIndex 不会 <0 因为如果关闭的是打开的最后一个模板,那么关闭之后 openedTemplate.isEmpty() = true selectedIndex = calNextShowJTemplateIndex(selectedIndex - 1); + } else { + selectedIndex = calNextShowJTemplateIndex(selectedIndex); } isCloseCurrent = false; }