Skip to content

Commit 4cdc383

Browse files
Preview: paint spritesheet outer frame.
1 parent 726c7c4 commit 4cdc383

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

source/phasereditor/phasereditor.assetpack.ui/src/phasereditor/assetpack/ui/widgets/SpritesheetPreviewCanvas.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public SpritesheetPreviewCanvas(Composite parent, int style) {
6767
_font = new Font(getDisplay(), new FontData(fd.getName(), fd.getHeight(), SWT.BOLD));
6868
setFont(_font);
6969
}
70-
70+
7171
@Override
7272
public void dispose() {
7373
super.dispose();
@@ -147,6 +147,7 @@ protected void drawMore(GC gc, int srcW, int srcH, int dstW, int dstH, int dstX,
147147
gc.fillRectangle(r.x, r.y, r.width, r.height);
148148
gc.setAlpha(255);
149149
}
150+
150151
gc.setAlpha(125);
151152
if (r.width >= 16) {
152153
gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_RED));
@@ -159,6 +160,15 @@ protected void drawMore(GC gc, int srcW, int srcH, int dstW, int dstH, int dstX,
159160
i++;
160161
}
161162

163+
{
164+
// paint outer frame
165+
Rectangle rect = calc.imageToScreen(imgBounds);
166+
gc.setAlpha(125);
167+
gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_RED));
168+
gc.drawRectangle(rect.x, rect.y, rect.width, rect.height);
169+
gc.setAlpha(255);
170+
}
171+
162172
{
163173
boolean paintIndexLabels = true;
164174

@@ -192,7 +202,7 @@ protected void drawMore(GC gc, int srcW, int srcH, int dstW, int dstH, int dstX,
192202
gc.drawString(label, left - 1, top + 1, true);
193203
gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_BLACK));
194204
gc.drawString(label, left + 1, top - 1, true);
195-
gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
205+
gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_YELLOW));
196206
gc.drawString(label, left, top, true);
197207
i++;
198208
}

0 commit comments

Comments
 (0)