Use the new resize image API to resize the pages while reading

This commit is contained in:
luisangelsm
2026-03-06 17:18:14 +01:00
parent 80de46ce74
commit de676a0fcb
2 changed files with 13 additions and 9 deletions

View File

@ -1,6 +1,7 @@
#include "continuous_page_widget.h"
#include "continuous_view_model.h"
#include "render.h"
#include "resize_image.h"
#include <QPainter>
#include <QPaintEvent>
@ -183,7 +184,8 @@ const QImage *ContinuousPageWidget::scaledImageForPaint(int pageIndex, const QIm
entry.sourceCacheKey = sourceKey;
entry.sourceSize = source->size();
entry.targetSize = targetSize;
entry.scaledImage = source->scaled(targetSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
entry.scaledImage = scaleImage(*source, targetSize.width(), targetSize.height(),
Configuration::getConfiguration().getScalingMethod());
scaledPageCache.pages.insert(pageIndex, std::move(entry));
return &scaledPageCache.pages[pageIndex].scaledImage;