Scales an AWT component according to Prefs#getGuiScale(). @param component the AWT component to be scaled. If a container, scaling is applied to all its child components
(final Component component)
| 219 | * @param component the AWT component to be scaled. If a container, scaling is applied to all its child components |
| 220 | */ |
| 221 | @AstroImageJ(reason = "Replace default fonts", modified = true) |
| 222 | public static void scale(final Component component) { |
| 223 | final float scale = (float)Prefs.getGuiScale(); |
| 224 | if (scale==1f) |
| 225 | return; |
| 226 | if (component instanceof Container) |
| 227 | scaleComponents((Container)component, scale); |
| 228 | else |
| 229 | scaleComponent(component, scale); |
| 230 | } |
| 231 | |
| 232 | private static void scaleComponents(final Container container, final float scale) { |
| 233 | for (final Component child : container.getComponents()) { |
no test coverage detected