MCPcopy Index your code
hub / github.com/processing/processing / setSize

Method setSize

core/src/processing/opengl/PSurfaceJOGL.java:748–772  ·  view source on GitHub ↗
(int wide, int high)

Source from the content-addressed store, hash-verified

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() {

Callers 1

initWindowMethod · 0.95

Calls 2

presentModeMethod · 0.80
setSizeMethod · 0.65

Tested by

no test coverage detected