Browse Source

qt/RoundImage: fix incorrect image displayed

previously when the image is found in the cache, the generator
was not reset, this caused an invalid image to be loaded

reset the image generator on update request
pull/134/head
Prince Gupta 5 years ago
committed by Jean-Baptiste Kempf
parent
commit
42dd825cff
  1. 3
      modules/gui/qt/widgets/native/roundimage.cpp

3
modules/gui/qt/widgets/native/roundimage.cpp

@ -243,6 +243,8 @@ void RoundImage::regenerateRoundImage()
if (!m_isComponentComplete || m_enqueuedGeneration)
return;
m_roundImageGenerator.reset();
// use Qt::QueuedConnection to delay generation, so that dependent properties
// subsequent updates can be merged, f.e when VLCStyle.scale changes
m_enqueuedGeneration = true;
@ -250,6 +252,7 @@ void RoundImage::regenerateRoundImage()
QMetaObject::invokeMethod(this, [this] ()
{
m_enqueuedGeneration = false;
assert(!m_roundImageGenerator);
const qreal scaleWidth = this->width() * m_dpr;
const qreal scaledHeight = this->height() * m_dpr;

Loading…
Cancel
Save