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

Method reapplySettings

core/src/processing/core/PGraphics.java:1019–1074  ·  view source on GitHub ↗

Re-apply current settings. Some methods, such as textFont(), require that their methods be called (rather than simply setting the textFont variable) because they affect the graphics context, or they require parameters from the context (e.g. getting native fonts for text). This will only be called f

()

Source from the content-addressed store, hash-verified

1017 * called before defaultSettings(), so we should be safe.
1018 */
1019 protected void reapplySettings() {
1020 // This might be called by allocate... So if beginDraw() has never run,
1021 // we don't want to reapply here, we actually just need to let
1022 // defaultSettings() get called a little from inside beginDraw().
1023 if (!settingsInited) return; // if this is the initial setup, no need to reapply
1024
1025 colorMode(colorMode, colorModeX, colorModeY, colorModeZ);
1026 if (fill) {
1027// PApplet.println(" fill " + PApplet.hex(fillColor));
1028 fill(fillColor);
1029 } else {
1030 noFill();
1031 }
1032 if (stroke) {
1033 stroke(strokeColor);
1034
1035 // The if() statements should be handled inside the functions,
1036 // otherwise an actual reset/revert won't work properly.
1037 //if (strokeWeight != DEFAULT_STROKE_WEIGHT) {
1038 strokeWeight(strokeWeight);
1039 //}
1040// if (strokeCap != DEFAULT_STROKE_CAP) {
1041 strokeCap(strokeCap);
1042// }
1043// if (strokeJoin != DEFAULT_STROKE_JOIN) {
1044 strokeJoin(strokeJoin);
1045// }
1046 } else {
1047 noStroke();
1048 }
1049 if (tint) {
1050 tint(tintColor);
1051 } else {
1052 noTint();
1053 }
1054// if (smooth) {
1055// smooth();
1056// } else {
1057// // Don't bother setting this, cuz it'll anger P3D.
1058// noSmooth();
1059// }
1060 if (textFont != null) {
1061// System.out.println(" textFont in reapply is " + textFont);
1062 // textFont() resets the leading, so save it in case it's changed
1063 float saveLeading = textLeading;
1064 textFont(textFont, textSize);
1065 textLeading(saveLeading);
1066 }
1067 textMode(textMode);
1068 textAlign(textAlign, textAlignY);
1069 background(backgroundColor);
1070
1071 blendMode(blendMode);
1072
1073 reapplySettings = false;
1074 }
1075
1076 // inherit from PImage

Callers 1

checkSettingsMethod · 0.95

Calls 15

colorModeMethod · 0.95
fillMethod · 0.95
noFillMethod · 0.95
strokeMethod · 0.95
strokeWeightMethod · 0.95
strokeCapMethod · 0.95
strokeJoinMethod · 0.95
noStrokeMethod · 0.95
tintMethod · 0.95
noTintMethod · 0.95
textFontMethod · 0.95
textLeadingMethod · 0.95

Tested by

no test coverage detected