Skip to content

Commit 38c4977

Browse files
committed
Move to private variables
1 parent 819f295 commit 38c4977

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/subtitles-octopus.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ var SubtitlesOctopus = function (options) {
6363

6464
self.hasAlphaBug = false;
6565

66+
// private
67+
var targetWidth; // Width of render target
68+
var targetHeight; // Height of render target
69+
6670
(function() {
6771
if (typeof ImageData.prototype.constructor === 'function') {
6872
try {
@@ -753,11 +757,11 @@ var SubtitlesOctopus = function (options) {
753757
self.canvas.style.pointerEvents = 'none';
754758
}
755759

756-
if (self.canvas._width !== width || self.canvas._height !== height) {
760+
if (targetWidth !== width || targetHeight !== height) {
757761
self.canvas.width = width;
758762
self.canvas.height = height;
759-
self.canvas._width = width;
760-
self.canvas._height = height;
763+
targetWidth = width;
764+
targetHeight = height;
761765

762766
self.worker.postMessage({
763767
target: 'canvas',

0 commit comments

Comments
 (0)