55 Rectangle imageBounds = image.getBounds(); |
55 Rectangle imageBounds = image.getBounds(); |
56 width = Math.min(width, imageBounds.width - x); |
56 width = Math.min(width, imageBounds.width - x); |
57 height = Math.min(height, imageBounds.height - y); |
57 height = Math.min(height, imageBounds.height - y); |
58 if (width > 0 && height > 0) |
58 if (width > 0 && height > 0) |
59 gc.drawImage(image, x, y, width, height, 0, 0, width, height); |
59 gc.drawImage(image, x, y, width, height, 0, 0, width, height); |
|
60 // gc.drawText(getClass().getSimpleName(), 2, 2); |
60 // gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE)); |
61 // gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE)); |
61 // gc.drawRectangle(1, 1, width - 2, height - 2); |
62 // gc.drawRectangle(1, 1, width - 2, height - 2); |
62 } |
63 } |
63 |
64 |
64 } |
65 } |