Skip to content

Commit 4713870

Browse files
arunjose696HeikoKlare
authored andcommitted
Add N&N for clarified ImageDataProvider contract and debugging support
Clarifies the requirement to an ImageDataProvider implementation of returning linearly scaled image data and refers to debugging support for linear scaling.
1 parent b283fc9 commit 4713870

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

news/4.37/platform_isv.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ Display.getDefault().asyncExec(() -> {
3636
});
3737
```
3838

39-
<!--
40-
---
39+
4140
## SWT Changes
42-
-->
4341

42+
### Clarified ImageDataProvider Contract
43+
44+
The `ImageDataProvider` API documentation has been updated to clarify that implementations are expected to return **linearly scaled** `ImageData` based on the zoom level.
45+
For example, if `getImageData(100)` returns an image of width `w` and height `h`, then `getImageData(200)` must return an image of width `2 * w` and height `2 * h`, if non-null.
46+
This only makes an implicit assumption explicit, some consumers have always relied on this linear scaling behavior, and lack of it may have led to unexpected behavior in the past.
4447

48+
Additionally, optional runtime checks verifying this linear scaling behavior are available as a debugging feature to assist developers in validating their implementations.
49+
These checks can be enabled by starting the application with `-Dorg.eclipse.swt.internal.enableStrictChecks`, but note that this system property may be subject to change in future releases without prior notice.

0 commit comments

Comments
 (0)