Skip to content

Commit

Permalink
Fixes #13 - Visualization does not resize
Browse files Browse the repository at this point in the history
Removed the JScrollPane which contained the JSVGCanvas and interfered
with the automatic resizing of the SVG
  • Loading branch information
bwRavencl committed May 7, 2024
1 parent 11f66a9 commit 161da5c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/de/bwravencl/controllerbuddy/gui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ public void windowOpened(final WindowEvent e) {
tabbedPane.addTab(strings.getString("VISUALIZATION_TAB"), visualizationPanel);

svgCanvas = new JSVGCanvas(null, false, false);
svgCanvas.setBackground(TRANSPARENT);
visualizationPanel.add(new JScrollPane(svgCanvas), BorderLayout.CENTER);
svgCanvas.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
visualizationPanel.add(svgCanvas, BorderLayout.CENTER);

final var exportPanel = new JPanel(LOWER_BUTTONS_FLOW_LAYOUT);
final var exportButton = new JButton(new ExportAction());
Expand Down Expand Up @@ -3227,6 +3227,8 @@ public void actionPerformed(final ActionEvent e) {
modeComboBox.setModel(model);
modeComboBox.setSelectedIndex(model.getSize() > 0 ? 0 : -1);
}

svgCanvas.setBackground(UIManager.getColor("Panel.background"));
}

public enum HotSwappingButton {
Expand Down

0 comments on commit 161da5c

Please sign in to comment.