Always convert to ARGB before rounding.
This commit is contained in:
parent
7e1effeeeb
commit
f93c2bb5e5
1 changed files with 4 additions and 4 deletions
|
|
@ -1011,6 +1011,10 @@ QImage Round(
|
||||||
return std::move(image);
|
return std::move(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
image = std::move(image).convertToFormat(
|
||||||
|
QImage::Format_ARGB32_Premultiplied);
|
||||||
|
Assert(!image.isNull());
|
||||||
|
|
||||||
// We need to detach image first (if it is shared), before we
|
// We need to detach image first (if it is shared), before we
|
||||||
// count some offsets using QImage::bytesPerLine etc, because
|
// count some offsets using QImage::bytesPerLine etc, because
|
||||||
// bytesPerLine may change on detach, this leads to crashes:
|
// bytesPerLine may change on detach, this leads to crashes:
|
||||||
|
|
@ -1068,10 +1072,6 @@ QImage Round(
|
||||||
}
|
}
|
||||||
Assert(!image.isNull());
|
Assert(!image.isNull());
|
||||||
|
|
||||||
image = std::move(image).convertToFormat(
|
|
||||||
QImage::Format_ARGB32_Premultiplied);
|
|
||||||
Assert(!image.isNull());
|
|
||||||
|
|
||||||
const auto masks = CornersMask(radius);
|
const auto masks = CornersMask(radius);
|
||||||
return Round(std::move(image), masks, corners, target);
|
return Round(std::move(image), masks, corners, target);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue