mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Use the new resize image API to resize the pages while reading
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user