Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Make Resources independent of scaling/zoom

Abierto
#3,527 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Tranquilo
Stack tecnológico
java
Área
desktop

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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();
Lenguaje dominante
Java
Estrellas
202
Forks
206
Merge medio
14 h 7 min
PR fusionados (30 d)
103

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de eclipse-platform/eclipse.platform.swt

Todos los issues de eclipse-platform/eclipse.platform.swt

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.