Pad svg logo

This commit is contained in:
2026-03-11 13:09:15 -06:00
parent 6b54654d7e
commit 51370040e0

View File

@@ -27,14 +27,16 @@ public final class SvgNodeLoader {
public static Pane loadSquare(String resourcePath, double size) {
Group content = readSvg(resourcePath);
var bounds = content.getLayoutBounds();
double scale = Math.min(size / bounds.getWidth(), size / bounds.getHeight());
double inset = size * 0.08;
double available = size - (inset * 2);
double scale = Math.min(available / bounds.getWidth(), available / bounds.getHeight());
Group graphic = new Group(content);
graphic.setScaleX(scale);
graphic.setScaleY(scale);
graphic.relocate(
(size - (bounds.getWidth() * scale)) / 2 - (bounds.getMinX() * scale),
(size - (bounds.getHeight() * scale)) / 2 - (bounds.getMinY() * scale)
inset + ((available - (bounds.getWidth() * scale)) / 2) - (bounds.getMinX() * scale),
inset + ((available - (bounds.getHeight() * scale)) / 2) - (bounds.getMinY() * scale)
);
Pane pane = new Pane(graphic);