| 617 | |
| 618 | |
| 619 | public void setSize(int wide, int high) { |
| 620 | // When the surface is set to resizable via surface.setResizable(true), |
| 621 | // a crash may occur if the user sets the window to size zero. |
| 622 | // https://github.com/processing/processing/issues/5052 |
| 623 | if (high <= 0) { |
| 624 | high = 1; |
| 625 | } |
| 626 | if (wide <= 0) { |
| 627 | wide = 1; |
| 628 | } |
| 629 | |
| 630 | //System.out.format("%s.setSize(%d, %d)%n", getClass().getSimpleName(), width, height); |
| 631 | Scene scene = stage.getScene(); |
| 632 | double decorH = stage.getWidth() - scene.getWidth(); |
| 633 | double decorV = stage.getHeight() - scene.getHeight(); |
| 634 | stage.setWidth(wide + decorH); |
| 635 | stage.setHeight(high + decorV); |
| 636 | fx.setSize(wide, high); |
| 637 | } |
| 638 | |
| 639 | |
| 640 | // public Component getComponent() { |