How does one retina?
This commit is contained in:
parent
135300b89a
commit
5cc16b47d0
@ -2,22 +2,22 @@
|
|||||||
|
|
||||||
#include "cropscene.hpp"
|
#include "cropscene.hpp"
|
||||||
#include "cropview.hpp"
|
#include "cropview.hpp"
|
||||||
|
#include <QApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QGraphicsPixmapItem>
|
#include <QGraphicsPixmapItem>
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
|
#include <QScreen>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <settings.hpp>
|
#include <settings.hpp>
|
||||||
|
|
||||||
CropEditor::CropEditor(QPixmap *image, QObject *parent) : QObject(parent) {
|
CropEditor::CropEditor(QPixmap *image, QObject *parent) : QObject(parent) {
|
||||||
scene = new CropScene(parent, image);
|
scene = new CropScene(parent, image);
|
||||||
view = new CropView(scene);
|
view = new CropView(scene);
|
||||||
QPixmap *scaled = new QPixmap();
|
qreal ratio = QApplication::primaryScreen()->devicePixelRatio();
|
||||||
image->scaled(view->width(), view->height()).swap(*scaled);
|
pixmapItem = new QGraphicsPixmapItem(image->scaled(image->width() / ratio, image->height() / ratio));
|
||||||
pixmapItem = new QGraphicsPixmapItem(*scaled);
|
|
||||||
pixmapItem->setZValue(-1);
|
pixmapItem->setZValue(-1);
|
||||||
scene->addItem(pixmapItem);
|
scene->addItem(pixmapItem);
|
||||||
scene->setSceneRect(image->rect());
|
scene->setSceneRect(image->rect());
|
||||||
view->setGeometry(0, 0, image->width(), image->height());
|
|
||||||
view->showFullScreen();
|
view->showFullScreen();
|
||||||
|
|
||||||
QTimer::singleShot(0, [&] { view->showFullScreen(); });
|
QTimer::singleShot(0, [&] { view->showFullScreen(); });
|
||||||
|
Loading…
Reference in New Issue
Block a user