Compare commits

..

No commits in common. "449f0eda314c699587756641a6f7a0b126cb1fe1" and "cb9fd93e51f768bd900c8bb903ee172684f01a68" have entirely different histories.

2 changed files with 8 additions and 24 deletions

View file

@ -692,26 +692,6 @@ watch(fontFamily, async (val) => {
if (val && val !== 'sans-serif') await loadFont(val); if (val && val !== 'sans-serif') await loadFont(val);
}); });
// Sync disabled special groups with TextSettings defaults
watch(() => textDefaults.fontFamily, (val) => {
if (!settingEnabled.font) fontFamily.value = val;
});
watch(() => textDefaults.fontSize, (val) => {
if (!settingEnabled.fontSize) {
fontSize.value = val.value;
fontSize.unit = val.unit;
}
}, { deep: true });
watch(() => textDefaults.lineHeight, (val) => {
if (!settingEnabled.lineHeight) {
lineHeight.value = val.value;
lineHeight.unit = val.unit;
}
}, { deep: true });
watch(() => textDefaults.color, (val) => {
if (!settingEnabled.color) color.value = val;
});
// Watchers simple props (with group guard) // Watchers simple props (with group guard)
for (const prop of styleProps) { for (const prop of styleProps) {
watch(prop.get, () => { watch(prop.get, () => {

View file

@ -138,10 +138,14 @@ export function usePreviewRenderer({
} }
); );
// Note: no separate watcher on fontFaceCss — the content watcher handles re-render. // Watch for font-face CSS changes (new font loaded) and re-render
// fontFaceCss is read from the store at render time in the srcdoc template. watch(
// loadFont() is awaited before updateStyle() in callers, so fontFaceCss is always () => stylesheetStore.fontFaceCss,
// up to date when the content watcher fires. () => {
if (!initialized.value) return;
renderPreview();
}
);
// Re-render when narrative data changes // Re-render when narrative data changes
watch( watch(