From 5ccdbc9417b29613c649f697c6406ff59e680fe4 Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sun, 25 Feb 2018 00:36:17 +0100 Subject: [PATCH] Fix issue that was shrinking the drawing when redrawing. --- src/main/org/insa/graphics/MainWindow.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/org/insa/graphics/MainWindow.java b/src/main/org/insa/graphics/MainWindow.java index e7fc76e..590e6e7 100644 --- a/src/main/org/insa/graphics/MainWindow.java +++ b/src/main/org/insa/graphics/MainWindow.java @@ -222,7 +222,7 @@ public class MainWindow extends JFrame { } private void updateDrawing(Class newClass) { - + int oldLocation = mainPanel.getDividerLocation(); drawing.clear(); if (drawing == null || !newClass.isInstance(drawing)) { try { @@ -232,8 +232,9 @@ public class MainWindow extends JFrame { e.printStackTrace(); } addDrawingClickListeners(); + mainPanel.setLeftComponent((Component) drawing); + mainPanel.setDividerLocation(oldLocation); } - mainPanel.setLeftComponent((Component) drawing); } private JMenuBar createMenuBar() {