small fixes in Image

This commit is contained in:
fourtf
2019-09-22 10:27:05 +02:00
parent 038fdd5446
commit da4714944d
4 changed files with 38 additions and 34 deletions
+11 -10
View File
@@ -1,5 +1,14 @@
#include "messages/Image.hpp"
#include <QBuffer>
#include <QImageReader>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QTimer>
#include <functional>
#include <thread>
#include "Application.hpp"
#include "common/Common.hpp"
#include "common/NetworkRequest.hpp"
@@ -11,15 +20,6 @@
#include "util/DebugCount.hpp"
#include "util/PostToThread.hpp"
#include <QBuffer>
#include <QImageReader>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QTimer>
#include <functional>
#include <thread>
namespace chatterino {
namespace detail {
// Frames
@@ -324,7 +324,7 @@ int Image::width() const
assertInGuiThread();
if (auto pixmap = this->frames_->first())
return pixmap->width() * this->scale_;
return int(pixmap->width() * this->scale_);
else
return 16;
}
@@ -369,6 +369,7 @@ void Image::actuallyLoad()
if (!shared)
return false;
// fourtf: is this the right thing to do?
shared->empty_ = true;
return true;