Skip to content

Commit a697c99

Browse files
committedMar 5, 2019
[processing] Fix initial zoom of models on hidpi displays
Fixes #16456 (cherry picked from commit 723051b)
1 parent 62a9d2b commit a697c99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎python/plugins/processing/modeler/ModelerDialog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,6 @@ def __init__(self, model=None):
298298
self.tabifyDockWidget(self.inputsDock, self.algorithmsDock)
299299
self.inputsDock.raise_()
300300

301-
self.zoom = 1
302-
303301
self.setWindowFlags(Qt.WindowMinimizeButtonHint |
304302
Qt.WindowMaximizeButtonHint |
305303
Qt.WindowCloseButtonHint)
@@ -314,6 +312,7 @@ def __init__(self, model=None):
314312
self.view.setScene(self.scene)
315313
self.view.setAcceptDrops(True)
316314
self.view.ensureVisible(0, 0, 10, 10)
315+
self.view.scale(QgsApplication.desktop().logicalDpiX() / 96, QgsApplication.desktop().logicalDpiX() / 96)
317316

318317
def _dragEnterEvent(event):
319318
if event.mimeData().hasText() or event.mimeData().hasFormat('application/x-vnd.qgis.qgis.algorithmid'):
@@ -549,6 +548,7 @@ def zoomOut(self):
549548
def zoomActual(self):
550549
point = self.view.mapToScene(QPoint(self.view.viewport().width() / 2, self.view.viewport().height() / 2))
551550
self.view.resetTransform()
551+
self.view.scale(QgsApplication.desktop().logicalDpiX() / 96, QgsApplication.desktop().logicalDpiX() / 96)
552552
self.view.centerOn(point)
553553

554554
def zoomToItems(self):

0 commit comments

Comments
 (0)
Please sign in to comment.