Skip to content

Conversation

@HeikoKlare
Copy link
Contributor

When running with a device zoom of 200, the bounds of images created with an ImageGcDrawer have double the expected size. The reason is that the image is initialized with image data at zoom 200, from which also the width and height are retrieved. The used initialization logic does, however, always expect image data at zoom 100 to be passed.

This change fixes the initialization of images based on ImageGcDrawer to create both the 100 and 200 image data version and correctly initialize the image metadata with the former. The according test case is extended to validate the bounds in pixels of images not only against the bounds if the image but also against the expected/initial bounds.

This API was introduced with the previous release and is yet only used for minimize/maximize icons of part stacks and the the line number ruler of editors. They do not use the bounds returned by these images, which is why the bug did not lead to any visible derivation of expected behavior yet. Once such images are used in a context whether the returned bounds matters, the issue will be visible by images having the double the expected size if used on a monitor with a zoom of 200.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2025

Test Results

   506 files  ±0     506 suites  ±0   9m 5s ⏱️ +47s
 4 340 tests ±0   4 326 ✅ ±0   14 💤 ±0  0 ❌ ±0 
16 596 runs  ±0  16 487 ✅ ±0  109 💤 ±0  0 ❌ ±0 

Results for commit 5542cea. ± Comparison against base commit 29bae82.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@akoch-yatta akoch-yatta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without being able to test, because I don't have a Mac at hand, I can only have a look at the code change. This looks fine to me.

When running with a device zoom of 200, the bounds of images created
with an ImageGcDrawer have double the expected size. The reason is that
the image is initialized with image data at zoom 200, from which also
the width and height are retrieved. The used initialization logic does,
however, always expect image data at zoom 100 to be passed.

This change fixes the initialization of images based on ImageGcDrawer to
create both the 100 and 200 image data version and correctly initialize
the image metadata with the former. The according test case is extended
to validate the bounds in pixels of images not only against the bounds
if the image but also against the expected/initial bounds.
@HeikoKlare HeikoKlare force-pushed the macos-imagegcdrawer-bounds branch from 8098626 to 5542cea Compare March 7, 2025 13:33
@HeikoKlare HeikoKlare merged commit 5a22598 into eclipse-platform:master Mar 7, 2025
14 checks passed
@HeikoKlare HeikoKlare deleted the macos-imagegcdrawer-bounds branch March 7, 2025 14:34
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.

2 participants