New formula to calculate drawn map sizes, now every FeatureSize leads to an unique size
It works by using 4 hardcoded map sizes and the rest is simply interpolated.
Size 1: 1024×512
Size 6: 2048×1024
Size 12: 4096×2048 (default, compatible with pre-1.0.0)
Size 25: 8192×4096
#include "preview_image_provider.h"
PreviewImageProvider::PreviewImageProvider()
: QQuickImageProvider(QQuickImageProvider::Pixmap) {}
QPixmap PreviewImageProvider::requestPixmap(const QString &id, QSize *size,
const QSize &requestedSize) {
Q_UNUSED(id);
Q_UNUSED(requestedSize);
if (size) *size = m_px.size();
return m_px;
}
void PreviewImageProvider::setImage(const QImage &preview) {
m_px = QPixmap::fromImage(preview, Qt::ColorOnly);
// QPixmap pxres(px.size());
// QPainter p(&pxres);
// p.fillRect(pxres.rect(), linearGrad);
// p.drawPixmap(0, 0, px);
}