Um...just looked at that code again. Was I drinking?
p.pushStyle = function PushStyle() {
p.pushMatrix();
var current = {'doFill':doFill, 'doStroke':doStroke,
'curTint':curTint,
'curRectMode':curRectMode, 'curColorMode':curColorMode,
'redRange':redRange, 'blueRange':blueRange,
'greenRange':greenRange,
'opacityRange':opacityRange, 'curTextFont':curTextFont,
'curTextSize':curTextSize};
styleStack.push(current);
};
p.popStyle = function popStyle() {
p.popMatrix();
var old = styleStack.pop();
doFill = old.doFill;
doStroke = old.doStroke;
curTint = old.curTint;
curRectMode = old.curRectmode;
curColorMode = old.curColorMode;
redRange = old.redRange;
blueRange = old.blueRange;
greenRange = old.greenRange;
opacityRange = old.opacityRange;
curTextFont = old.curTextFont;
curTextSize = old.curTextSize;
};
Still, there must be a cleaner way. Clearly my JS-ing is failing as I
get more senile...
Any other solutions?