Skip to content

Commit

Permalink
Fix fit-to-window
Browse files Browse the repository at this point in the history
Closes #213
  • Loading branch information
stevebauman committed Sep 6, 2024
1 parent 80fdcf7 commit 2809182
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions components/Window.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 2 additions & 4 deletions pages/generator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 2809182

Please sign in to comment.