Skip to content

Replace usages of new Image(device, width, height) / new GC(image) #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignees
Labels
HiDPI A HiDPI-Related Issue or Feature SWT Issue for SWT
Milestone

Comments

@HeikoKlare
Copy link
Contributor

As documented in #171, images instantiated with a fixed width/height, which are usually used as a canvas to manually draw an, are insufficient for multi-zoom scenarios, in which an image to be drawn on demand may be required in different sizes.

In #143, a new constructor for Image, taking an ImageGcDrawer, has been introduced to replace the implementation in above mentioned use cases with a dynamic generation of an image at the propert size.

This is a follow-up task consisting of the following steps:

  • Replace all calls to new Image(device, width, height) with a subsequent call to new GC(image) with a proper ImageGcDrawer
  • Reprecate the Image constructor taking a device, width, and height.
@HeikoKlare HeikoKlare added this to HiDPI Jan 19, 2025
@HeikoKlare HeikoKlare converted this from a draft issue Jan 19, 2025
@HeikoKlare HeikoKlare added SWT Issue for SWT HiDPI A HiDPI-Related Issue or Feature labels Jan 19, 2025
@HeikoKlare HeikoKlare added this to the 4.36 M1 milestone Jan 19, 2025
@HeikoKlare
Copy link
Contributor Author

Can you please check whether this is a reasonable task, @akoch-yatta?

@ShahzaibIbrahim ShahzaibIbrahim moved this from 🔖 Ready: Atomic to 🏗 In Work: Short in HiDPI Mar 17, 2025
@ShahzaibIbrahim ShahzaibIbrahim self-assigned this Mar 17, 2025
@ShahzaibIbrahim
Copy link

ShahzaibIbrahim commented Mar 18, 2025

Attaching file to categorize the usages in order to separately deal with the changes. First priority being replacing in Platform/SWT

UsageForImageConstructor.xlsx

@fedejeanne
Copy link

@ShahzaibIbrahim please address this comment too: eclipse-platform/eclipse.platform.ui#2869 (comment)

Keep in mind that SimpleImageDescriptor is a private class that is only being used in tests so it might be even worth to delete it and use its sibling class: ComplexImageDescriptor (or maybe even other subclass of AbstractImageDescriptor).

@github-project-automation github-project-automation bot moved this from 👀 In Review to ✅ Done in HiDPI Apr 9, 2025
@fedejeanne fedejeanne moved this from ✅ Done to 👀 In Review in HiDPI Apr 9, 2025
@fedejeanne fedejeanne reopened this Apr 10, 2025
@fedejeanne fedejeanne modified the milestones: 4.36 M1, 4.36 M2 Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment