From f169ac0401e896f5865111b139298a9abfa31a3a Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 19 Jul 2018 21:48:13 +0200 Subject: Mitigate flashing screen with fading --- pointless/viewer/screen.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pointless/viewer/screen.js') diff --git a/pointless/viewer/screen.js b/pointless/viewer/screen.js index 28f4f55..42ea781 100644 --- a/pointless/viewer/screen.js +++ b/pointless/viewer/screen.js @@ -29,7 +29,7 @@ class Screen { this.timer.start(); this.page = page; - this._refreshPage(); + this._changePage(); this.pageTurnCount++; } @@ -69,6 +69,15 @@ class Screen { }); } + _changePage() { + this.canvas.style.opacity = 0; + var self = this; + setTimeout(function() { + self._refreshPage(); + self.canvas.style.opacity = 1; + }, 300); + } + _refreshPage() { if (this.page == null) return; var viewport = this.page.getViewport(1); -- cgit v1.2.3