Fix a frozen menu in the notification modal

This commit is contained in:
James Babcock committed 2026-09-25 22:06:44 -07:00
1 parent cc1ae93fde
commit 459560cd72
2 files changed
+28 -2

No files matched your search

+10 -2
View File
@@ -52,11 +52,19 @@ export class ShellModalLayer implements Layer {
this.stack.setBaseSize(interior);
// Flattening bakes the inner stack's planes (glyphs included) so the blit
// below transplants the finished modal content into this layer's plane.
const inner = flattenPlanes(this.stack.paint(), interior);
// The top plane's retained presentations (a menu's selection highlight
// and scroll strip) stay unbaked: they are display lists the glasses
// animate, and baking one freezes it on its first frame. Lower planes'
// are baked so the top plane's raster still covers them.
const planes = this.stack.paint();
const top = planes[planes.length - 1]!;
const inner = flattenPlanes(planes.map((plane) => plane === top ? { ...plane, image: plane.image.withDrawsBaked(false) } : plane), interior);
const rect = modalRect();
const innerX = rect.x + MODAL_PADDING, innerY = rect.y + MODAL_PADDING;
image.fillRect(rect.x, rect.y, rect.width, rect.height, SHELL_OPAQUE_BLACK);
image.drawRect(rect.x, rect.y, rect.width, rect.height, 110);
image.bitBlt(inner, rect.x + MODAL_PADDING, rect.y + MODAL_PADDING, { transparentZero: true });
image.bitBlt(inner, innerX, innerY, { transparentZero: true });
top.image.copyPresentationsInto(image, innerX + top.x, innerY + top.y);
return image;
}