Skip to content

Commit

Permalink
fix: jagged edges on ddciicon
Browse files Browse the repository at this point in the history
Use smooth scaling before drawing to smaller QImage

Issue: linuxdeepin/developer-center#8691
  • Loading branch information
mhduiy committed Jun 20, 2024
1 parent 7fee7b5 commit da27fb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/ddciicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,8 @@ void DDciIconPrivate::paint(QPainter *painter, const QRectF &rect, Qt::Alignment
if (rect.width() < targetRect.width())
targetRect = rect;

painter->drawImage(targetRect, layer);
auto scaleImage = layer.scaled(targetRect.size().toSize(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
painter->drawImage(targetRect, scaleImage);
}
}

Expand Down

0 comments on commit da27fb7

Please sign in to comment.