(int wide, int high)
| 746 | |
| 747 | |
| 748 | public void setSize(int wide, int high) { |
| 749 | if (pgl.presentMode()) return; |
| 750 | |
| 751 | // When the surface is set to resizable via surface.setResizable(true), |
| 752 | // a crash may occur if the user sets the window to size zero. |
| 753 | // https://github.com/processing/processing/issues/5052 |
| 754 | if (high <= 0) { |
| 755 | high = 1; |
| 756 | } |
| 757 | if (wide <= 0) { |
| 758 | wide = 1; |
| 759 | } |
| 760 | |
| 761 | boolean changed = sketch.width != wide || sketch.height != high; |
| 762 | |
| 763 | sketchWidth = wide; |
| 764 | sketchHeight = high; |
| 765 | |
| 766 | sketch.setSize(wide, high); |
| 767 | graphics.setSize(wide, high); |
| 768 | |
| 769 | if (changed) { |
| 770 | window.setSize(wide * windowScaleFactor, high * windowScaleFactor); |
| 771 | } |
| 772 | } |
| 773 | |
| 774 | |
| 775 | public float getPixelScale() { |
no test coverage detected