takes care of #2102 by reverting setAmbient to false if it was false

before calling popStyle()
This commit is contained in:
codeanticode
2013-10-03 13:51:56 -04:00
parent 665a46969d
commit 0388ebbe4a
@@ -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)