diff options
author | Stephan Schwär | 2020-12-03 03:18:31 +0100 |
---|---|---|
committer | Stephan Schwär | 2020-12-03 03:18:31 +0100 |
commit | 306e6141b244e9a65808d4034f93fa8e30186070 (patch) | |
tree | 6fb73cd5d9cdd3a5aca6c07b963aff27931aa1a3 /dozentenmodul/src/main/java/org/openslx/dozmod/App.java | |
parent | [client] Make table background use look and feel (diff) | |
download | tutor-module-306e6141b244e9a65808d4034f93fa8e30186070.tar.gz tutor-module-306e6141b244e9a65808d4034f93fa8e30186070.tar.xz tutor-module-306e6141b244e9a65808d4034f93fa8e30186070.zip |
[client] Prevent scaling of fonts multiple times
Fonts in various contexts e.g. FileChooser were scaled multiple times
Issue #3794
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/App.java')
-rwxr-xr-x | dozentenmodul/src/main/java/org/openslx/dozmod/App.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/App.java b/dozentenmodul/src/main/java/org/openslx/dozmod/App.java index 7df920a2..499c5e60 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/App.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/App.java @@ -315,13 +315,15 @@ public class App { ContainerEvent containerEvent = (ContainerEvent) event; if (containerEvent.getID() == ContainerEvent.COMPONENT_ADDED) { Font font = containerEvent.getChild().getFont(); + // Do not update font in tables and ComboBoxes on every renderer call to prevent weirdness. + // This prevents multiple instances of fonts being scaled multiple times. + if (containerEvent.getChild().getName() != null){ + return; + } if (font != null && font.getSize2D() <= defaultSize) { - // Do not update font in tables and ComboBoxes on every renderer call to prevent weirdness. - if (!(containerEvent.getChild() instanceof TableCellRenderer || containerEvent.getChild() instanceof ListCellRenderer)){ containerEvent.getChild().setFont( new Font(font.getName(), font.getStyle(), Math.round(font.getSize2D() * scaling))); - } } } } |