From a1446324c34c33c21e58dc7275fa31b0b01a78ed Mon Sep 17 00:00:00 2001 From: turuslan Date: Mon, 28 Feb 2022 08:54:15 +0300 Subject: [PATCH] fix resize Signed-off-by: turuslan --- src/subtitles-octopus.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/subtitles-octopus.js b/src/subtitles-octopus.js index 64981e04..f80d7730 100644 --- a/src/subtitles-octopus.js +++ b/src/subtitles-octopus.js @@ -453,14 +453,9 @@ var SubtitlesOctopus = function (options) { if ( - self.canvas.width != width || - self.canvas.height != height || - self.canvas.style.top != top || - self.canvas.style.left != left + self.canvas.style.top != top + 'px' || + self.canvas.style.left != left + 'px' ) { - self.canvas.width = width; - self.canvas.height = height; - if (videoSize != null) { self.canvasParent.style.position = 'relative'; self.canvas.style.display = 'block'; @@ -471,6 +466,13 @@ var SubtitlesOctopus = function (options) { self.canvas.style.left = left + 'px'; self.canvas.style.pointerEvents = 'none'; } + } + if ( + self.canvas.width != width || + self.canvas.height != height + ) { + self.canvas.width = width; + self.canvas.height = height; self.worker.postMessage({ target: 'canvas',