mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[escher] BurgerMenuView: when drawRect, reinitialize the rectangle to
avoid corruption when re-drawing above a burger. Indeed, blendRectWithMask pulls the current color to blend it.
This commit is contained in:
@@ -41,7 +41,12 @@ void BurgerMenuView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
KDCoordinate heightCenter = bounds().height()/2;
|
||||
KDCoordinate burgerHalfSize = k_burgerSize/2;
|
||||
KDRect frame(widthCenter - burgerHalfSize, heightCenter - burgerHalfSize, k_burgerSize, k_burgerSize);
|
||||
// Reinitialize the color of the rectangle to avoid corruptions after successive drawings of burger view
|
||||
KDColor sample = ctx->getPixel(KDPointZero);
|
||||
ctx->fillRect(bounds(), sample);
|
||||
// Draw the circle
|
||||
ctx->blendRectWithMask(frame, m_backgroundColor, (const uint8_t *)sCircleMask, sBurgerWorkingBuffer);
|
||||
// Draw the burger
|
||||
ctx->blendRectWithMask(frame, KDColorBlack, (const uint8_t *)sBurgerMask, sBurgerWorkingBuffer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user