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',