TomTroppmann пре 3 година
родитељ
комит
c81bba3cc9
2 измењених фајлова са 6 додато и 5 уклоњено
  1. 5 4
      src/ui/view/CanvasResizePopUp.java
  2. 1 1
      src/ui/view/GUI.java

+ 5 - 4
src/ui/view/CanvasResizePopUp.java

@@ -55,16 +55,17 @@ public class CanvasResizePopUp extends JDialog {
 				int width = model.getCanvasX();
 				int height = model.getCanvasY();
 				Dimension preferedSize = new Dimension(width, height);
-				canvas.setPreferredSize(preferedSize);
+				canvas.setPreferredSize(new Dimension(preferedSize));
 				for (int i = 1; i < tabbedPane.getTabCount(); i++) {
 					if (tabbedPane.getComponentAt(i) != null) {
 						JScrollPane scollPane = (JScrollPane) tabbedPane.getComponentAt(i);
-						GroupNodeCanvas unc = ((GroupNodeCanvas) (scollPane)
+						GroupNodeCanvas groupNodeCanvas = ((GroupNodeCanvas) (scollPane)
 								.getViewport().getComponent(0));
-						unc.setPreferredSize(preferedSize);
-						unc.repaint();
+						groupNodeCanvas.setPreferredSize(new Dimension(preferedSize));
+						groupNodeCanvas.repaint();
 					}
 				}
+				canvas.revalidate();
 				canvas.repaint();
 				
 				controller.getModel().getAllAbstractObjectsOnCanvas().stream().forEach(obj -> {

+ 1 - 1
src/ui/view/GUI.java

@@ -738,7 +738,7 @@ public class GUI {
 
 		mnNewMenuView.add(mntmCanvasSize);
 		mntmCanvasSize.addActionListener(actionEvent -> {
-			CanvasResizePopUp popUp = new CanvasResizePopUp(model, controller, canvas, tabbedPaneOriginal,
+			CanvasResizePopUp popUp = new CanvasResizePopUp(model, controller, canvas, this.tabbedPaneInnerOriginal,
 					holegJFrame);
 			popUp.setVisible(true);
 		});