Skip to content

Commit eea5214

Browse files
committed
Clarified ImageDataProvider Contract and Debugging Support for Linear Scaling
1 parent 9a9e1b8 commit eea5214

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

news/4.37/platform_isv.md

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

39-
<!--
40-
---
41-
## SWT Changes
42-
-->
4339

40+
## SWT Changes
4441

42+
### Clarified ImageDataProvider Contract
43+
44+
The `ImageDataProvider` API documentation has been updated to clarify that
45+
implementations are expected to return **linearly scaled** `ImageData`
46+
based on the zoom level. For example, if `getImageData(100)` returns
47+
an image of width *w* and height *h*, then `getImageData(200)` must
48+
return an image of width `2 * w` and height `2 * h`, if non-null.
49+
This is only makes an implicit assumption explicit, some consumers have always
50+
relied on this linear scaling behavior, and lack of it may have led to unexpected behavior in the past.
51+
52+
Additionally, strict runtime checks verifying this linear scaling behavior
53+
are available as a debugging feature to assist developers in validating
54+
their implementations.
55+
These checks can be enabled by starting Java with the `-Dorg.eclipse.swt.internal.enableStrictChecks`,
56+
but note that this system property may be subject to change in future releases without
57+
prior notice.

0 commit comments

Comments
 (0)