Поправка бага при resize

This commit is contained in:
Book Pauk
2020-11-06 01:08:22 +07:00
parent ca40854106
commit f07a157a2a

View File

@@ -234,7 +234,10 @@ class ExternalLibs extends Vue {
this.justOpened = true;
this.$root.addKeyHook(this.keyHook);
this.$root.$on('resize', this.frameResize);
this.$root.$on('resize', async() => {
await utils.sleep(200);
this.frameResize();
});
document.addEventListener('fullscreenchange', () => {
this.fullScreenActive = (document.fullscreenElement !== null);
@@ -521,6 +524,8 @@ class ExternalLibs extends Vue {
}
frameResize() {
this.$refs.frameWrap.style = 'width: 1px; height: 1px;';
this.$nextTick(() => {
if (this.$refs.frame) {
const w = this.$refs.frameBox.offsetWidth;
const h = this.$refs.frameBox.offsetHeight;
@@ -533,6 +538,7 @@ class ExternalLibs extends Vue {
this.$refs.frame.style = normalSize;
}
}
});
}
changeScale(delta) {