HCanvas displays incorrect alpha when autoClear is disabled
cadin opened this issue · 2 comments
cadin commented
When using autoClear(false)
on HCanvas, HDrawables with an alpha set seem to display at about half of the specified alpha value.
This simple sketch demonstrates the issue:
import hype.*;
HCanvas canvas;
HRect rect;
void setup() {
size(200,200);
H.init(this).background(#ffffff);
canvas = new HCanvas().autoClear(false);
H.add(canvas);
// Clearing the PGraphics will force proper alpha display
// canvas.graphics().clear();
canvas.add( rect = new HRect(50) ).fill(#000000).alpha(128);
noLoop();
}
void draw() {
H.drawStage();
}
If you sample the rect color on screen you can see it's 25% gray instead of the expected 50%.
Setting autoClear(true)
works as expected.
One workaround I found is to explicitly clear the PGraphics (see commented line above).
This wasn't a problem in Processing 2.x using the old PDE-based Hype. I've only noticed it since moving to Processing 3 and the lib-staging distro.
(I'm running Processing 3.3.7 on OS X)
cadin commented
cadin commented
This seems to be a Processing issue, not a Hype issue:
processing/processing#3391
Thanks for reading!