MCPcopy Create free account
hub / github.com/benfry/processing4 / setSize

Method setSize

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

Source from the content-addressed store, hash-verified

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

Callers 1

initWindowMethod · 0.95

Calls 2

presentModeMethod · 0.80
setSizeMethod · 0.65

Tested by

no test coverage detected