Too big sprites now get scaled down smoothly, while too small ones keep their sharpness as they're expanded.

This commit is contained in:
Cerapter 2018-09-15 18:38:30 +02:00
parent f3e9d691af
commit cc854adb51

View File

@ -152,7 +152,10 @@ void AOCharMovie::frame_change(int 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)