Follow-up to 7a63e7f: use better method to avoid PNG transparency on score media generation

This commit is contained in:
Dmitri Ovodok 2020-01-22 11:37:49 +02:00
parent 7a63e7f0cd
commit 042303c7eb

View file

@ -2621,7 +2621,7 @@ bool MuseScore::savePng(Score* score, const QString& name)
bool MuseScore::savePng(Score* score, QIODevice* device, int pageNumber, bool drawPageBackground)
{
const bool screenshot = false;
const bool transparent = preferences.getBool(PREF_EXPORT_PNG_USETRANSPARENCY);
const bool transparent = preferences.getBool(PREF_EXPORT_PNG_USETRANSPARENCY) && !drawPageBackground;
const double convDpi = preferences.getDouble(PREF_EXPORT_PNG_RESOLUTION);
const int localTrimMargin = trimMargin;
const QImage::Format format = QImage::Format_ARGB32_Premultiplied;
@ -2664,9 +2664,6 @@ bool MuseScore::savePng(Score* score, QIODevice* device, int pageNumber, bool dr
if (localTrimMargin >= 0)
p.translate(-r.topLeft());
if (drawPageBackground)
p.fillRect(r, Qt::white);
QList< Element*> pel = page->elements();
qStableSort(pel.begin(), pel.end(), elementLessThan);
paintElements(p, pel);