Skip to content

Commit f45097a

Browse files
committed
Image handle refactoring for win32
This contribution encapsulates the metadata of the image in an innerclass ImageHandle which is used to create a hashmap of zoom level to imageHandle object inside an image object, making it straight forward to obtain any metadata information from an image for a zoom level. contributes to #62 and #127
1 parent 1ced8a9 commit f45097a

File tree

1 file changed

+2
-2
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

1 file changed

+2
-2
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ private Rectangle getBoundsInPixelsFromNative(long handle) {
21082108
case SWT.BITMAP:
21092109
BITMAP bm = new BITMAP();
21102110
OS.GetObject(handle, BITMAP.sizeof, bm);
2111-
return new Rectangle(0, 0, width = bm.bmWidth, height = bm.bmHeight);
2111+
return new Rectangle(0, 0, bm.bmWidth, bm.bmHeight);
21122112
case SWT.ICON:
21132113
ICONINFO info = new ICONINFO();
21142114
OS.GetIconInfo(handle, info);
@@ -2119,7 +2119,7 @@ private Rectangle getBoundsInPixelsFromNative(long handle) {
21192119
if (hBitmap == info.hbmMask) bm.bmHeight /= 2;
21202120
if (info.hbmColor != 0) OS.DeleteObject(info.hbmColor);
21212121
if (info.hbmMask != 0) OS.DeleteObject(info.hbmMask);
2122-
return new Rectangle(0, 0, width = bm.bmWidth, height = bm.bmHeight);
2122+
return new Rectangle(0, 0, bm.bmWidth, bm.bmHeight);
21232123
default:
21242124
SWT.error(SWT.ERROR_INVALID_IMAGE);
21252125
return null;

0 commit comments

Comments
 (0)