From 3190246f348c96957686bca2b7d4b01116f81a08 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Tue, 12 Jul 2022 01:35:19 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=80=D0=B5=D0=B0=D0=BA=D1=86=D0=B8=D1=8F=20=D0=BD?= =?UTF-8?q?=D0=B0=20onResize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/TextPage/TextPage.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index 7a1cc4f0..d03cc78e 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -163,8 +163,7 @@ class TextPage { }, 10); this.$root.addEventHook('resize', async() => { - this.$nextTick(this.onResize); - await utils.sleep(500); + await utils.sleep(200); this.$nextTick(this.onResize); }); } @@ -508,12 +507,25 @@ class TextPage { } async onResize() { + if (this.resizing) + return; + + this.resizing = true; try { + const scrolled = this.doingScrolling; + if (scrolled) + await this.stopTextScrolling(); + this.calcDrawProps(); this.setBackground(); this.draw(); + + if (scrolled) + this.startTextScrolling(); } catch (e) { // + } finally { + this.resizing = false; } }