Resize frame for these sketch (canvas) dimensions.
()
| 667 | |
| 668 | /** Resize frame for these sketch (canvas) dimensions. */ |
| 669 | private Dimension setFrameSize() { //int sketchWidth, int sketchHeight) { |
| 670 | // https://github.com/processing/processing/pull/3162 |
| 671 | frame.addNotify(); // using instead of show() to add the peer [fry] |
| 672 | |
| 673 | // System.out.format("setting frame size %d %d %n", sketchWidth, sketchHeight); |
| 674 | // new Exception().printStackTrace(System.out); |
| 675 | currentInsets = frame.getInsets(); |
| 676 | int windowW = Math.max(sketchWidth, MIN_WINDOW_WIDTH) + |
| 677 | currentInsets.left + currentInsets.right; |
| 678 | int windowH = Math.max(sketchHeight, MIN_WINDOW_HEIGHT) + |
| 679 | currentInsets.top + currentInsets.bottom; |
| 680 | frame.setSize(windowW, windowH); |
| 681 | return new Dimension(windowW, windowH); |
| 682 | } |
| 683 | |
| 684 | |
| 685 | private void setFrameCentered() { |
no test coverage detected