Fix: Edge case bug where episodes preview became randomly tiny

pull/30/head 2.0.6
Juraj Nyíri 3 years ago
parent 7be18026c9
commit 77a563fe18

@ -21089,11 +21089,11 @@ class PlexMeetsHomeAssistant extends HTMLElement {
if (areaSize > 0) {
CSS_STYLE.width = areaSize / postersInRow - marginRight;
CSS_STYLE.height = CSS_STYLE.width * CSS_STYLE.ratio;
}
const episodesInRow = Math.floor(areaSize / CSS_STYLE.minimumEpisodeWidth);
CSS_STYLE.episodeWidth = Math.floor(areaSize / episodesInRow - marginRight);
CSS_STYLE.episodeHeight = Math.round(CSS_STYLE.episodeWidth * CSS_STYLE.episodeRatio);
}
}
this.renderedItems = 0;
this.columnsCount = 0;
const spinner = document.createElement('div');

@ -497,13 +497,12 @@ class PlexMeetsHomeAssistant extends HTMLElement {
if (areaSize > 0) {
CSS_STYLE.width = areaSize / postersInRow - marginRight;
CSS_STYLE.height = CSS_STYLE.width * CSS_STYLE.ratio;
}
const episodesInRow = Math.floor(areaSize / CSS_STYLE.minimumEpisodeWidth);
CSS_STYLE.episodeWidth = Math.floor(areaSize / episodesInRow - marginRight);
CSS_STYLE.episodeHeight = Math.round(CSS_STYLE.episodeWidth * CSS_STYLE.episodeRatio);
}
}
this.renderedItems = 0;
this.columnsCount = 0;

Loading…
Cancel
Save