From f60f40fbdb95ed72633f5e9763f82f5870231380 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 22 May 2017 11:55:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=8E=86=E5=8F=B2=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E5=B0=91=E4=BA=8E3=E4=B8=AA=E6=97=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/style/color/UsedColorPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/design/style/color/UsedColorPane.java b/designer_base/src/com/fr/design/style/color/UsedColorPane.java index 5594254c37..732f512223 100644 --- a/designer_base/src/com/fr/design/style/color/UsedColorPane.java +++ b/designer_base/src/com/fr/design/style/color/UsedColorPane.java @@ -42,7 +42,7 @@ public class UsedColorPane extends BasicPane { * @param rows 行 * @param columns 列 * @param reserveCells 留白的单元格个数 - * @param colors 最近使用的颜色 + * @param selectable * @param needPickColorButton 是否需要加上取色器按钮 * @param setColorRealTime 取色器是否实时设定颜色 */ @@ -68,7 +68,6 @@ public class UsedColorPane extends BasicPane { //最近使用颜色 Color[] colors = ColorSelectConfigManager.getInstance().getColors(); int size = colors.length; - int i = 0; if (needPickColorButton) { // 取色按钮 @@ -84,7 +83,8 @@ public class UsedColorPane extends BasicPane { i++; } while (i < total) { - Color color = i < size ? colors[size - (i - this.reserveCells) - 1] : DEFAULT_COLOR; + Color color = i - this.reserveCells < size ? colors[size - (i - this.reserveCells) - 1] : + DEFAULT_COLOR; panel.add(new ColorCell(color == null ? DEFAULT_COLOR : color, selectable)); i++; } @@ -100,7 +100,7 @@ public class UsedColorPane extends BasicPane { int size = colors.length; for (int i = this.reserveCells; i < total; i++) { ColorCell cell = (ColorCell) this.pane.getComponent(i); - Color color = i < size ? colors[size - (i - this.reserveCells) - 1] : DEFAULT_COLOR; + Color color = i - this.reserveCells < size ? colors[size - (i - this.reserveCells) - 1] : DEFAULT_COLOR; cell.setColor(color == null ? DEFAULT_COLOR : color); } }