mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
takes care of #2102 by reverting setAmbient to false if it was false
before calling popStyle()
This commit is contained in:
@@ -4519,8 +4519,20 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
return nonZero(ow) ? oz / ow : oz;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// STYLES
|
||||
|
||||
@Override
|
||||
public void popStyle() {
|
||||
// popStyle() sets ambient to true (because it calls ambient() in style())
|
||||
// and so setting the setAmbient flag to true, even if the user didn't call
|
||||
// ambient, so need to revert to false.
|
||||
boolean savedSetAmbient = setAmbient;
|
||||
super.popStyle();
|
||||
if (!savedSetAmbient) setAmbient = false;
|
||||
}
|
||||
|
||||
// public void pushStyle()
|
||||
// public void popStyle()
|
||||
// public void style(PStyle)
|
||||
|
||||
Reference in New Issue
Block a user