ソースを参照

Fixes Set Size

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);
 		});