Fix issue that was shrinking the drawing when redrawing.
This commit is contained in:
parent
0236798ef5
commit
5ccdbc9417
@ -222,7 +222,7 @@ public class MainWindow extends JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateDrawing(Class<? extends Drawing> newClass) {
|
private void updateDrawing(Class<? extends Drawing> newClass) {
|
||||||
|
int oldLocation = mainPanel.getDividerLocation();
|
||||||
drawing.clear();
|
drawing.clear();
|
||||||
if (drawing == null || !newClass.isInstance(drawing)) {
|
if (drawing == null || !newClass.isInstance(drawing)) {
|
||||||
try {
|
try {
|
||||||
@ -232,8 +232,9 @@ public class MainWindow extends JFrame {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
addDrawingClickListeners();
|
addDrawingClickListeners();
|
||||||
}
|
|
||||||
mainPanel.setLeftComponent((Component) drawing);
|
mainPanel.setLeftComponent((Component) drawing);
|
||||||
|
mainPanel.setDividerLocation(oldLocation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private JMenuBar createMenuBar() {
|
private JMenuBar createMenuBar() {
|
||||||
|
Loading…
Reference in New Issue
Block a user