(int wide, int high)
| 710 | |
| 711 | |
| 712 | public void setSize(int wide, int high) { |
| 713 | if (pgl.presentMode()) return; |
| 714 | |
| 715 | // When the surface is set to resizable via surface.setResizable(true), |
| 716 | // a crash may occur if the user sets the window to size zero. |
| 717 | // https://github.com/processing/processing/issues/5052 |
| 718 | if (high <= 0) { |
| 719 | high = 1; |
| 720 | } |
| 721 | if (wide <= 0) { |
| 722 | wide = 1; |
| 723 | } |
| 724 | |
| 725 | boolean changed = sketch.width != wide || sketch.height != high; |
| 726 | |
| 727 | sketchWidth = wide; |
| 728 | sketchHeight = high; |
| 729 | |
| 730 | sketch.setSize(wide, high); |
| 731 | graphics.setSize(wide, high); |
| 732 | |
| 733 | if (changed) { |
| 734 | window.setSize(wide * windowScaleFactor, high * windowScaleFactor); |
| 735 | } |
| 736 | } |
| 737 | |
| 738 | |
| 739 | public float getPixelScale() { |
no test coverage detected