Skip to content

Commit 0722559

Browse files
committed
Do not reset prerender cache when resize is not actually a resize
1 parent 93f4d0f commit 0722559

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/subtitles-octopus.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ var SubtitlesOctopus = function (options) {
409409
if (self.renderAhead > 0) {
410410
var newCache = [];
411411
if (isResizing && self.oneshotState.prevHeight && self.oneshotState.prevWidth) {
412+
if (self.oneshotState.prevHeight == self.canvas.height &&
413+
self.oneshotState.prevWidth == self.canvas.width) return;
412414
var timeLimit = 10, sizeLimit = self.renderAhead * 0.3;
413415
if (self.canvas.height >= self.oneshotState.prevHeight * (1.0 - self.resizeVariation) &&
414416
self.canvas.height <= self.oneshotState.prevHeight * (1.0 + self.resizeVariation) &&

0 commit comments

Comments
 (0)