Skip to content

Commit

Permalink
Do not reset prerender cache when resize is not actually a resize
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAMan committed Mar 25, 2020
1 parent 93f4d0f commit 0722559
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/subtitles-octopus.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ var SubtitlesOctopus = function (options) {
if (self.renderAhead > 0) {
var newCache = [];
if (isResizing && self.oneshotState.prevHeight && self.oneshotState.prevWidth) {
if (self.oneshotState.prevHeight == self.canvas.height &&
self.oneshotState.prevWidth == self.canvas.width) return;
var timeLimit = 10, sizeLimit = self.renderAhead * 0.3;
if (self.canvas.height >= self.oneshotState.prevHeight * (1.0 - self.resizeVariation) &&
self.canvas.height <= self.oneshotState.prevHeight * (1.0 + self.resizeVariation) &&
Expand Down

0 comments on commit 0722559

Please sign in to comment.