Resize frame for these sketch (canvas) dimensions.
()
| 813 | |
| 814 | /** Resize frame for these sketch (canvas) dimensions. */ |
| 815 | private Dimension setFrameSize() { //int sketchWidth, int sketchHeight) { |
| 816 | // https://github.com/processing/processing/pull/3162 |
| 817 | frame.addNotify(); // using instead of show() to add the peer [fry] |
| 818 | |
| 819 | // System.out.format("setting frame size %d %d %n", sketchWidth, sketchHeight); |
| 820 | // new Exception().printStackTrace(System.out); |
| 821 | currentInsets = frame.getInsets(); |
| 822 | int windowW = Math.max(sketchWidth, MIN_WINDOW_WIDTH) + |
| 823 | currentInsets.left + currentInsets.right; |
| 824 | int windowH = Math.max(sketchHeight, MIN_WINDOW_HEIGHT) + |
| 825 | currentInsets.top + currentInsets.bottom; |
| 826 | frame.setSize(windowW, windowH); |
| 827 | return new Dimension(windowW, windowH); |
| 828 | } |
| 829 | |
| 830 | |
| 831 | private void setFrameCentered() { |
no test coverage detected