Skip to content

Commit 73d6346

Browse files
committed
Fix width check in Image.HandleAtSize.isReusable on Win32
The second condition in isReusable() compared handleContainer.height() against both height and width due to a copy-paste error. This caused unnecessary image handle recreation for non-square images. Use handleContainer.width() for the width comparison.
1 parent 99e5332 commit 73d6346

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private boolean isReusable(int width, int height) {
232232
return false;
233233
}
234234
return (requestedHeight == height && requestedWidth == width)
235-
|| (handleContainer.height() == height && handleContainer.height() == width);
235+
|| (handleContainer.height() == height && handleContainer.width() == width);
236236
}
237237

238238
private Optional<InternalImageHandle> createHandleAtExactSize(int width, int height) {

0 commit comments

Comments
 (0)