Skip to content
Permalink
Browse files

[processing] Fix initial zoom of models on hidpi displays

Fixes #16456

(cherry picked from commit 723051b)
  • Loading branch information
nyalldawson committed Mar 7, 2019
1 parent f97dfc3 commit cc3d5fbd22afa4d6cea3833d2055ccc596435603
Showing with 2 additions and 2 deletions.
  1. +2 −2 python/plugins/processing/modeler/ModelerDialog.py
@@ -289,8 +289,6 @@ def __init__(self, model=None):
self.tabifyDockWidget(self.inputsDock, self.algorithmsDock)
self.inputsDock.raise_()

self.zoom = 1

self.setWindowFlags(Qt.WindowMinimizeButtonHint |
Qt.WindowMaximizeButtonHint |
Qt.WindowCloseButtonHint)
@@ -305,6 +303,7 @@ def __init__(self, model=None):
self.view.setScene(self.scene)
self.view.setAcceptDrops(True)
self.view.ensureVisible(0, 0, 10, 10)
self.view.scale(QgsApplication.desktop().logicalDpiX() / 96, QgsApplication.desktop().logicalDpiX() / 96)

def _dragEnterEvent(event):
if event.mimeData().hasText() or event.mimeData().hasFormat('application/x-vnd.qgis.qgis.algorithmid'):
@@ -547,6 +546,7 @@ def zoomOut(self):
def zoomActual(self):
point = self.view.mapToScene(QPoint(self.view.viewport().width() / 2, self.view.viewport().height() / 2))
self.view.resetTransform()
self.view.scale(QgsApplication.desktop().logicalDpiX() / 96, QgsApplication.desktop().logicalDpiX() / 96)
self.view.centerOn(point)

def zoomToItems(self):

0 comments on commit cc3d5fb

Please sign in to comment.
You can’t perform that action at this time.