8b28a9b11a
Добавлена кисть маркера на пульте и презентации с настройками в панели эффектов; штрихи привязаны к жёлтой рамке, ластик и очистка работают с отдельным сессионным слоем. Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
862 B
TypeScript
31 lines
862 B
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
|
|
import { applySceneMarkerEraserStroke } from './sceneMarkerEraser';
|
|
import type { SceneMarkerStroke } from './types/sceneMarker';
|
|
|
|
void test('applySceneMarkerEraserStroke: удаляет точки под ластиком', () => {
|
|
const strokes: SceneMarkerStroke[] = [
|
|
{
|
|
id: 'm1',
|
|
seed: 1,
|
|
createdAtMs: 100,
|
|
points: [
|
|
{ x: 0.1, y: 0.5, tMs: 100 },
|
|
{ x: 0.5, y: 0.5, tMs: 101 },
|
|
{ x: 0.9, y: 0.5, tMs: 102 },
|
|
],
|
|
radiusN: 0.04,
|
|
color: '#ff0000',
|
|
},
|
|
];
|
|
const next = applySceneMarkerEraserStroke(
|
|
strokes,
|
|
[{ x: 0.5, y: 0.5, tMs: 200 }],
|
|
0.06,
|
|
(prefix) => `${prefix}_new`,
|
|
);
|
|
assert.ok(next.length >= 1);
|
|
assert.ok(next.every((s) => s.points.every((p) => Math.abs(p.x - 0.5) > 0.05)));
|
|
});
|