This commit is contained in:
Andras Schmelczer 2026-05-17 14:12:01 +01:00
commit 80ed37298b
73 changed files with 3619 additions and 1295 deletions

View file

@ -252,6 +252,31 @@ describe('GardenPointerInput drawing startup', () => {
expect(brushPipeline.addSwipeSegment.mock.calls.length).toBeGreaterThan(3);
});
it('passes normalized audio geometry context with stroke events', async () => {
const { audio, canvas } = await createPointerInput();
canvas.dispatchPointerEvent('pointerdown', { pointerId: 9, timeStamp: 100 });
canvas.dispatchPointerEvent('pointermove', {
clientX: 40,
clientY: 50,
pointerId: 9,
timeStamp: 150,
});
expect(audio.stroke).toHaveBeenCalledWith(
expect.objectContaining({
canvasSize: [300, 200],
elapsedSeconds: 0.05,
from: expect.anything(),
isErasing: false,
to: expect.anything(),
})
);
const stroke = audio.stroke.mock.calls[0][0];
expect(toPoint(stroke.from)).toEqual([10, 20]);
expect(toPoint(stroke.to)).toEqual([40, 50]);
});
it('caps curve tessellation with the brush curve resolution setting', async () => {
const { brushPipeline, canvas, runtimeSettings } = await createPointerInput();
runtimeSettings.brushCurveResolution = 2;