perf: trim session IPC hot paths and fix clear-effects idle render
Skip full project broadcast on graph/NPC position commits, send session.stateChanged only to consumer windows, and force one Pixi render before stopping the idle ticker so Clear effects actually clears the canvas. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,6 +29,8 @@ void test('PxiEffectsOverlay: lazy VFX packs + idle ticker stop', () => {
|
||||
assert.ok(src.includes('collectNeededVfxPacks'));
|
||||
assert.ok(src.includes('syncTickerForState'));
|
||||
assert.ok(src.includes('app.ticker.stop'));
|
||||
// После clear нужен явный render, иначе «очистить» замораживает кадр вместо исчезновения.
|
||||
assert.match(src, /app\.render\?\.\(\);[\s\S]*?app\.ticker\.stop/);
|
||||
// Eager preload всех наборов при init убран.
|
||||
assert.doesNotMatch(
|
||||
src,
|
||||
|
||||
@@ -223,6 +223,13 @@ export const PixiEffectsOverlay = forwardRef<PixiEffectsOverlayHandle, Props>(fu
|
||||
root.x = 0;
|
||||
root.y = 0;
|
||||
}
|
||||
// Без этого кадра после syncNodes (clear) canvas остаётся со старым кадром:
|
||||
// анимация «встаёт», но спрайты визуально не исчезают.
|
||||
try {
|
||||
app.render?.();
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
try {
|
||||
app.ticker.stop();
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user