Skip to content

Conversation

@HeikoKlare
Copy link
Contributor

Recently, the ability to scale images for the desired target size of a drawImage operation executed on a GC and the incorporation of a Transform potentially applied to that GC have been implemented. With this, the target size for an image to be drawn can become 0 and the request of a handle of that size can fail, in particular when trying to rasterize an SVG at that size.

This change adapts the implementation of the handle retrieval for a desired size in the Image implementation so that the minimum size of the provided handle is 1 in both of the dimensions. The draw operation in the GC will then take care of potentially not drawing anything at all when the actual intended size is really 0.
It also adds a test case for the specific case of requesting a handle at size 0 and also adds a test for the general correctness of image handle retrieval when a transform is applied to the GC.

Fixes #3078

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

Test Results

  176 files  ±0    176 suites  ±0   27m 41s ⏱️ - 1m 0s
4 694 tests +1  4 672 ✅ +1  22 💤 ±0  0 ❌ ±0 
  489 runs  ±0    483 ✅ ±0   6 💤 ±0  0 ❌ ±0 

Results for commit aaa4309. ± Comparison against base commit 4a95cb2.

♻️ This comment has been updated with latest results.

Recently, the ability to scale images for the desired target size of a
drawImage operation executed on a GC and the incorporation of a
Transform potentially applied to that GC have been implemented. With
this, the target size for an image to be drawn can become 0 and the
request of a handle of that size can fail, in particular when trying to
rasterize an SVG at that size.

This change adapts the implementation of the handle retrieval for a
desired size in the Image implementation so that the minimum size of the
provided handle is 1 in both of the dimensions. The draw operation in
the GC will then take care of potentially not drawing anything at all
when the actual intended size is really 0.
It also adds a test case for the specific case of requesting a handle at
size 0 and also adds a test for the general correctness of image handle
retrieval when a transform is applied to the GC.

Fixes eclipse-platform#3078
@HeikoKlare
Copy link
Contributor Author

Consequences of the addressed issue (failing GC operations) are potentially severe, such that this issue should be fixed for the release. In order to have it tested with the last milestone build to detect potential unintended effects, this should go in M3. Unintended effects are unlikely though as the issue is about the intent to draw an image at width or hight 0, such that the actual image content is irrelevant anyway.

@HeikoKlare HeikoKlare merged commit 588e560 into eclipse-platform:master Feb 12, 2026
23 checks passed
@HeikoKlare HeikoKlare deleted the issue-3078 branch February 12, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: SWTException "Invalid image" when rasterizing SVG at size 0 after moving Eclipse window between monitors (DPI change)

1 participant