Fix MIST gallery scene controls, video positioning and audio overlap
This commit is contained in:
1 parent
19924e1c5a
commit
4dc660f786
10 files changed
+197
-12
No files matched your search
@@ -332,3 +332,27 @@ test("a redraw queued before pointerdown preserves the Return button until click
|
||||
manager.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
test("hover keeps image-button geometry and does not redraw screens for absent hover actions", async () => {
|
||||
const { manager, calls } = setup();
|
||||
const c = v => ({ k: 'const', v });
|
||||
manager.screens.hoverTest = { params: [], props: {}, defaults: [], body: [
|
||||
{ w: 'imagebutton', args: [], body: [], props: { idle: c('idle.png'), hover: c('hover.png'), hover_sound: c('hover.ogg') } },
|
||||
] };
|
||||
try {
|
||||
manager.show('hoverTest');
|
||||
const button = manager.layer.querySelector('.pg-simgbtn');
|
||||
const images = [...button.querySelectorAll('img')];
|
||||
assert.equal(images.length, 2, 'both state images participate in layout before hovering');
|
||||
button.onmouseenter();
|
||||
await settle();
|
||||
assert.equal(manager.layer.querySelector('.pg-simgbtn'), button, 'no hover rebuild under the pointer');
|
||||
assert.deepEqual([...button.querySelectorAll('img')], images, 'images stay attached across state changes');
|
||||
assert.deepEqual(images.map(el => el.style.opacity), ['0', '1']);
|
||||
assert.deepEqual(calls.play, [['sound', 'hover.ogg', false]]);
|
||||
button.onmouseleave();
|
||||
await settle();
|
||||
assert.equal(manager.layer.querySelector('.pg-simgbtn'), button);
|
||||
assert.deepEqual(images.map(el => el.style.opacity), ['1', '0']);
|
||||
} finally { manager.destroy(); }
|
||||
});
|
||||
Reference in new issue
Block a user