// gc.translate(
// bounds.x * tsize.x,
// bounds.y * tsize.y);
while (itr.hasNext()) {
MapObject mo = itr.next();
double ox = mo.getX() * zoom;
double oy = mo.getY() * zoom;
Image objectImage = mo.getImage(zoom);
if (objectImage != null) {
gc.drawImage(objectImage, (int) ox, (int) oy);
}
int objWidth = mo.getWidth();
int objHeight = mo.getHeight();
if (objWidth == 0 || objHeight == 0) {
gc.setAntialias(SWT.ON);
gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_BLACK));
gc.fillOval((int) ox + 1, (int) oy + 1,
(int) (10 * zoom), (int) (10 * zoom));
gc.setBackground(getDisplay().getSystemColor(OBJECT_FOREGROUND));
gc.fillOval((int) ox, (int) oy,
(int) (10 * zoom), (int) (10 * zoom));
gc.setAntialias(SWT.OFF);
} else {
gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_BLACK));
gc.drawRectangle((int) ox + 1, (int) oy + 1,
(int) (objWidth * zoom),
(int) (objHeight * zoom));
gc.setForeground(getDisplay().getSystemColor(OBJECT_FOREGROUND));
gc.drawRectangle((int) ox, (int) oy,
(int) (objWidth * zoom),
(int) (objHeight * zoom));
}
if (zoom > 0.0625) {
if (drawResizeAnchors) {
drawAnchors(gc, ox, oy, objWidth, objHeight);
}
final String s = mo.getName() != null ? mo.getName() : "(null)";
gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_BLACK));
gc.drawString(s, (int) (ox - 5) + 1, (int) (oy - 5) + 1);
gc.setForeground(getDisplay().getSystemColor(OBJECT_FOREGROUND));
gc.drawString(s, (int) (ox - 5), (int) (oy - 5));