MCPcopy Index your code
hub / github.com/benfry/processing4 / setFrameSize

Method setFrameSize

core/src/processing/awt/PSurfaceAWT.java:669–682  ·  view source on GitHub ↗

Resize frame for these sketch (canvas) dimensions.

()

Source from the content-addressed store, hash-verified

667
668 /** Resize frame for these sketch (canvas) dimensions. */
669 private Dimension setFrameSize() { //int sketchWidth, int sketchHeight) {
670 // https://github.com/processing/processing/pull/3162
671 frame.addNotify(); // using instead of show() to add the peer [fry]
672
673// System.out.format("setting frame size %d %d %n", sketchWidth, sketchHeight);
674// new Exception().printStackTrace(System.out);
675 currentInsets = frame.getInsets();
676 int windowW = Math.max(sketchWidth, MIN_WINDOW_WIDTH) +
677 currentInsets.left + currentInsets.right;
678 int windowH = Math.max(sketchHeight, MIN_WINDOW_HEIGHT) +
679 currentInsets.top + currentInsets.bottom;
680 frame.setSize(windowW, windowH);
681 return new Dimension(windowW, windowH);
682 }
683
684
685 private void setFrameCentered() {

Callers 2

placeWindowMethod · 0.95
setSizeMethod · 0.95

Calls 2

setSizeMethod · 0.65
maxMethod · 0.45

Tested by

no test coverage detected