Skip to content

Commit 73d162e

Browse files
(v2) Scene editor: draw selection labels.
1 parent e452ea9 commit 73d162e

File tree

1 file changed

+16
-3
lines changed
  • source/v2/phasereditor/phasereditor.scene.ui/src/phasereditor/scene/ui/editor

1 file changed

+16
-3
lines changed

source/v2/phasereditor/phasereditor.scene.ui/src/phasereditor/scene/ui/editor/SceneCanvas.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,29 @@ private void renderSelection(GC gc) {
311311
gc.setLineWidth(3);
312312
gc.setAlpha(150);
313313
gc.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLACK));
314-
314+
315315
gc.drawPolygon(new int[] { (int) bounds[0], (int) bounds[1], (int) bounds[2], (int) bounds[3],
316316
(int) bounds[4], (int) bounds[5], (int) bounds[6], (int) bounds[7] });
317-
317+
318318
gc.setAlpha(255);
319319
gc.setLineWidth(1);
320-
320+
321321
gc.setForeground(selectionColor);
322322
gc.drawPolygon(new int[] { (int) bounds[0], (int) bounds[1], (int) bounds[2], (int) bounds[3],
323323
(int) bounds[4], (int) bounds[5], (int) bounds[6], (int) bounds[7] });
324+
325+
var name = EditorComponent.get_editorName(model);
326+
327+
var x = bounds[0];
328+
var y = bounds[1];
329+
330+
gc.setAlpha(150);
331+
gc.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLACK));
332+
gc.drawText(name, (int) x - 1, (int) y - 21, true);
333+
334+
gc.setAlpha(255);
335+
gc.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
336+
gc.drawText(name, (int) x, (int) y - 20, true);
324337
}
325338
}
326339
}

0 commit comments

Comments
 (0)