Fix flicker

This commit is contained in:
Drew Slobodnjak
2025-12-04 11:07:45 -08:00
parent 34305670c5
commit 7be8de044c
+11 -1
View File
@@ -696,9 +696,16 @@ export class ElementState implements LayerElement {
}
updateData(ctx: DimensionContext) {
const previousData = this.data;
if (this.item.prepareData) {
this.data = this.item.prepareData(ctx, this.options);
this.revId++; // rerender
// Only increment revId if data actually changed (not just position)
// This prevents flickering when only position updates
if (JSON.stringify(this.data) !== JSON.stringify(previousData)) {
this.revId++;
}
}
// Update placement values from dimension context
@@ -727,6 +734,9 @@ export class ElementState implements LayerElement {
}
}
// Apply updated positions without forcing a remount
this.applyLayoutStylesToDiv();
const scene = this.getScene();
const frames = scene?.data?.series;