diff --git a/components/Window.vue b/components/Window.vue index bb84c67..4d54503 100644 --- a/components/Window.vue +++ b/components/Window.vue @@ -235,6 +235,11 @@ const props = defineProps({ }, }); +defineExpose({ + actualWidth: () => root.value.clientWidth, + actualHeight: () => root.value.clientHeight, +}); + const emit = defineEmits(['update:scale', 'update:title']); const { fontFamilies } = useFonts(); diff --git a/pages/generator.vue b/pages/generator.vue index 9f14b47..ddeba22 100644 --- a/pages/generator.vue +++ b/pages/generator.vue @@ -66,12 +66,10 @@ export default { watch(pane, (value) => { if (settings.lockWindowSize) { settings.width = - (pane.value.actualWidth() + Number(settings.lockWindowPaddingX)) * - settings.scale; + (value.actualWidth() + Number(settings.lockWindowPaddingX)) * settings.scale; settings.height = - (pane.value.actualHeight() + Number(settings.lockWindowPaddingY)) * - settings.scale; + (value.actualHeight() + Number(settings.lockWindowPaddingY)) * settings.scale; } nextTick(() => (ready.value = true));