feat(ComparisonStore): pin fontA/fontB to prevent eviction while on-screen
This commit is contained in:
@@ -134,6 +134,19 @@ export class ComparisonStore {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Effect 4: Pin fontA/fontB so eviction never removes on-screen fonts
|
||||
$effect(() => {
|
||||
const fa = this.#fontA;
|
||||
const fb = this.#fontB;
|
||||
const w = typographySettingsStore.weight;
|
||||
if (fa) appliedFontsManager.pin(fa.id, w, fa.features?.isVariable);
|
||||
if (fb) appliedFontsManager.pin(fb.id, w, fb.features?.isVariable);
|
||||
return () => {
|
||||
if (fa) appliedFontsManager.unpin(fa.id, w, fa.features?.isVariable);
|
||||
if (fb) appliedFontsManager.unpin(fb.id, w, fb.features?.isVariable);
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user