aboutsummaryrefslogtreecommitdiff
path: root/beamer/viewer/screen
diff options
context:
space:
mode:
Diffstat (limited to 'beamer/viewer/screen')
-rw-r--r--beamer/viewer/screen/screen.js14
1 files changed, 5 insertions, 9 deletions
diff --git a/beamer/viewer/screen/screen.js b/beamer/viewer/screen/screen.js
index c65ebc3..7cfc54b 100644
--- a/beamer/viewer/screen/screen.js
+++ b/beamer/viewer/screen/screen.js
@@ -1,6 +1,6 @@
1/* 1/*
2 * Beamer Viewer, a web-based PDF presentation viewer 2 * Beamer Viewer, a web-based PDF presentation viewer
3 * Copyright (C) 2018 Pacien TRAN-GIRARD 3 * Copyright (C) 2018-2023 Pacien TRAN-GIRARD
4 * 4 *
5 * This program is free software: you can redistribute it and/or modify 5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as 6 * it under the terms of the GNU Affero General Public License as
@@ -42,10 +42,7 @@ class Screen {
42 } 42 }
43 43
44 _registerListeners() { 44 _registerListeners() {
45 const self = this; 45 this.window.addEventListener("resize", () => this._repaint());
46 this.window.addEventListener("resize", function() {
47 self._repaint();
48 });
49 } 46 }
50 47
51 _hideWelcomeScreen() { 48 _hideWelcomeScreen() {
@@ -91,10 +88,9 @@ class Screen {
91 viewport: this.page.getViewport(scaleFactor) 88 viewport: this.page.getViewport(scaleFactor)
92 }; 89 };
93 90
94 const self = this; 91 this.page
95 this.page.render(renderContext).then(function() { 92 .render(renderContext)
96 self._showCanvas(canvas); 93 .then(() => this._showCanvas(canvas));
97 });
98 } 94 }
99 95
100 _repaint() { 96 _repaint() {