mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fixed an issue where normal emotes would be redrawn like gif emotes
This commit is contained in:
parent
86c844c791
commit
cc1e3c2f6f
|
@ -75,6 +75,15 @@ void Image::loadImage()
|
|||
|
||||
bool first = true;
|
||||
|
||||
// clear stuff before loading the image again
|
||||
lli->allFrames.clear();
|
||||
if (lli->isAnimated()) {
|
||||
util::DebugCount::decrease("animated images");
|
||||
}
|
||||
if (lli->isLoaded) {
|
||||
util::DebugCount::decrease("loaded images");
|
||||
}
|
||||
|
||||
for (int index = 0; index < reader.imageCount(); ++index) {
|
||||
if (reader.read(&image)) {
|
||||
auto pixmap = new QPixmap(QPixmap::fromImage(image));
|
||||
|
|
|
@ -147,6 +147,7 @@ void MessageLayout::paint(QPainter &painter, int y, int messageIndex, Selection
|
|||
|
||||
this->buffer = std::shared_ptr<QPixmap>(pixmap);
|
||||
this->bufferValid = false;
|
||||
util::DebugCount::increase("message drawing buffers");
|
||||
}
|
||||
|
||||
if (!this->bufferValid || !selection.isEmpty()) {
|
||||
|
@ -221,8 +222,12 @@ void MessageLayout::invalidateBuffer()
|
|||
|
||||
void MessageLayout::deleteBuffer()
|
||||
{
|
||||
if (this->buffer != nullptr) {
|
||||
util::DebugCount::decrease("message drawing buffers");
|
||||
|
||||
this->buffer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Elements
|
||||
// assert(QThread::currentThread() == QApplication::instance()->thread());
|
||||
|
|
|
@ -105,6 +105,7 @@ void ImageLayoutElement::paintAnimated(QPainter &painter, int yOffset)
|
|||
}
|
||||
|
||||
if (this->image->isAnimated()) {
|
||||
// qDebug() << this->image->getUrl();
|
||||
auto pixmap = this->image->getPixmap();
|
||||
|
||||
if (pixmap != nullptr) {
|
||||
|
|
Loading…
Reference in a new issue