// Do a quick check to make sure the selection is not empty
if (brushLayer.isEmpty()) {
JOptionPane.showMessageDialog(appFrame, Resources.getString("dialog.selection.empty"),
Resources.getString("dialog.selection.empty"), JOptionPane.WARNING_MESSAGE);
} else {
setBrush(new CustomBrush(brushLayer));
cursorHighlight.setOffset(tile.x - (int) bounds.getWidth() / 2, tile.y - (int) bounds.getHeight() / 2);
}
} else if (mouseButton == MouseEvent.BUTTON1 && layer instanceof ObjectGroup) {
// TODO: Fix this to use pixels in the first place
// (with optional snap to grid)