Normalize svg logo

This commit is contained in:
2026-03-11 13:33:56 -06:00
parent eed8b3e99c
commit bfbcc1caae

View File

@@ -33,17 +33,20 @@ public final class SvgNodeLoader {
double scale = Math.min(available / bounds.getWidth(), available / bounds.getHeight());
Group graphic = new Group(content);
graphic.setTranslateX(-bounds.getMinX());
graphic.setTranslateY(-bounds.getMinY());
graphic.setScaleX(scale);
graphic.setScaleY(scale);
graphic.relocate(
inset + ((available - (bounds.getWidth() * scale)) / 2) - (bounds.getMinX() * scale),
inset + ((available - (bounds.getHeight() * scale)) / 2) - (bounds.getMinY() * scale)
inset + ((available - (bounds.getWidth() * scale)) / 2),
inset + ((available - (bounds.getHeight() * scale)) / 2)
);
Pane pane = new Pane(graphic);
pane.setMinSize(size, size);
pane.setPrefSize(size, size);
pane.setMaxSize(size, size);
pane.setClip(new Rectangle(size, size));
return pane;
}