Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Make Resources independent of scaling/zoom

Aperta
#3,527 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
java
Ambito
desktop

Direzione di ricerca

Start by reading the existing TextLayout, Font, Control, and GC APIs and the monitor-specific zoom and autoscaling behavior described in the issue. Compare the proposed constructors and determine the resource-lifetime and compatibility implications; done means the API design resolves zoom-related rounding without relying on a resource-level zoom value.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Currently, Resources like TextLayout or Font have a nativeZoom or zoom value set. This is inconsistent with recent SWT features on Windows of a) monitor-specific zoom (different shells might have different zoom factors) and b) some controls have disabled autoscaling. This causes serious rounding problem like reported in #3461 that can't be worked-around by the SWT user.

IMHO to avoid any zoom-related rounding errors it needs API change to define the Control or GC onto which these resources should work.

Example:

TextLayout textLayout = new TextLayout(gc); // <-- new constructor
textLayout.setFont(font);
textLayout.setText(text);
final Rectangle bounds = textLayout.getBounds();
textLayout.setWidth(bounds.width + widthCorrection);
textLayout.draw(gc, x, y);
textLayout.dispose();

or

TextLayout textLayout = new TextLayout(control); // <-- new constructor
textLayout.setFont(font);
textLayout.setText(text);
final Rectangle bounds = textLayout.getBounds();
textLayout.setWidth(bounds.width + widthCorrection);
textLayout.draw(gc, x, y);
textLayout.dispose();
Lingua principale
Java
Stelle
202
Fork
206
Merge medio
16h 56m
PR unite (30g)
110

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-platform/eclipse.platform.swt

Tutte le issue di eclipse-platform/eclipse.platform.swt

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.