2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-04 16:45:12 +00:00

Added ability to unload not visible GIFs as heavy parts in overview.

This commit is contained in:
23rd
2021-07-22 20:57:48 +03:00
committed by John Preston
parent 039ffd3d34
commit a153059b38
5 changed files with 22 additions and 1 deletions

View File

@@ -1895,7 +1895,8 @@ void Gif::clipCallback(Media::Clip::Notification notification) {
height,
ImageRoundRadius::None, RectPart::None);
}
} else if (_gif->autoPausedGif()/* && !context()->inlineItemVisible(this)*/) {
} else if (_gif->autoPausedGif()
&& !delegate()->itemVisible(this)) {
clearHeavyPart();
}
}
@@ -2057,9 +2058,17 @@ void Gif::ensureDataMediaCreated() const {
}
void Gif::clearHeavyPart() {
_gif.reset();
_dataMedia = nullptr;
}
void Gif::setPosition(int32 position) {
ItemBase::setPosition(position);
if (position < 0) {
_gif.reset();
}
}
float64 Gif::dataProgress() const {
ensureDataMediaCreated();
return _dataMedia->progress();