fix(tokens): импорт неигровых токенов из zip и плавные пути на macOS
Полный импорт/открытие проекта подхватывает app-tokens. Движение по путям пишется в DOM без ре-рендера кадра, у пульта и презентации выключен background throttling. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { writeTokenPathTransform } from './tokenPathLiveDom';
|
||||
|
||||
void test('writeTokenPathTransform: GPU-friendly translate3d, not left/top', () => {
|
||||
const el = { style: { transform: '' } } as unknown as HTMLElement;
|
||||
writeTokenPathTransform(el, 0.25, 0.5, 45, { x: 10, y: 20, w: 200, h: 100 }, true);
|
||||
assert.equal(el.style.transform, 'translate3d(60px, 70px, 0) translate(-50%, -50%) rotate(45deg)');
|
||||
});
|
||||
|
||||
void test('writeTokenPathTransform: NPC without rotate keeps centering only', () => {
|
||||
const el = { style: { transform: '' } } as unknown as HTMLElement;
|
||||
writeTokenPathTransform(el, 0, 0, 90, { x: 0, y: 0, w: 100, h: 100 }, false);
|
||||
assert.equal(el.style.transform, 'translate3d(0px, 0px, 0) translate(-50%, -50%)');
|
||||
});
|
||||
Reference in New Issue
Block a user