Too big sprites now get scaled down smoothly, while too small ones keep their sharpness as they're expanded.
This commit is contained in:
parent
f3e9d691af
commit
cc854adb51
@ -152,7 +152,10 @@ void AOCharMovie::frame_change(int n_frame)
|
|||||||
{
|
{
|
||||||
QPixmap f_pixmap = QPixmap::fromImage(movie_frames.at(n_frame));
|
QPixmap f_pixmap = QPixmap::fromImage(movie_frames.at(n_frame));
|
||||||
|
|
||||||
this->setPixmap(f_pixmap.scaled(this->width(), this->height()));
|
if (f_pixmap.size().width() > this->size().width() || f_pixmap.size().height() > this->size().height())
|
||||||
|
this->setPixmap(f_pixmap.scaled(this->width(), this->height(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation));
|
||||||
|
else
|
||||||
|
this->setPixmap(f_pixmap.scaled(this->width(), this->height(), Qt::KeepAspectRatioByExpanding, Qt::FastTransformation));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_movie->frameCount() - 1 == n_frame && play_once)
|
if (m_movie->frameCount() - 1 == n_frame && play_once)
|
||||||
|
Loading…
Reference in New Issue
Block a user