mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
do not detach from QImage::setColorCount() if color count is not different
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
09dddc3258
commit
e6d2f453c7
1 changed files with 3 additions and 3 deletions
|
@ -1699,7 +1699,7 @@ void QImage::fill(const QColor &color)
|
|||
uint pixel = color.rgba();
|
||||
if (d->format == QImage::Format_ARGB32_Premultiplied)
|
||||
pixel = PREMUL(pixel);
|
||||
fill((uint) pixel);
|
||||
fill(pixel);
|
||||
|
||||
} else if (d->depth == 16 && d->format == QImage::Format_RGB16) {
|
||||
qrgb565 p(color.rgba());
|
||||
|
@ -1807,12 +1807,12 @@ void QImage::setColorCount(int colorCount)
|
|||
if (!d) {
|
||||
qWarning("QImage::setColorCount: null image");
|
||||
return;
|
||||
} else if (colorCount == d->colortable.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
detach();
|
||||
|
||||
if (colorCount == d->colortable.size())
|
||||
return;
|
||||
if (colorCount <= 0) { // use no color table
|
||||
d->colortable = QVector<QRgb>();
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue