From ac26789650de6e04e05c3eadf71a230d8e71ea3c Mon Sep 17 00:00:00 2001 From: arunjose696 Date: Mon, 11 Aug 2025 17:17:21 +0200 Subject: [PATCH] Clarify linear scaling in ImageDataProvider contract Clarify in the contract that ImageDataProvider implementations are expected to return linearly scaled ImageData based on the zoom level. --- .../swt/graphics/ImageDataProvider.java | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataProvider.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataProvider.java index bfa0ec70a73..826973891c6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataProvider.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataProvider.java @@ -28,16 +28,31 @@ public interface ImageDataProvider { /** * Returns the image data for the given zoom level. - *

- * If no image is available for a particular zoom level, this method should - * return null. For zoom == 100, returning - * null is not allowed, and SWT will throw an exception. + * + *

+ * * * @param zoom * The zoom level in % of the standard resolution (which is 1 * physical monitor pixel == 1 SWT logical point). Typically 100, * 150, or 200. - * @return the image data, or null if zoom != 100 + * @return the linearly scaled image data for the given zoom level, + * or null if zoom != 100 * and no image is available for the given zoom level. * @since 3.104 */