Skip to content
Permalink
Browse files

[processing] Fix initial zoom of models on hidpi displays

Fixes #16456
  • Loading branch information
nyalldawson committed Mar 4, 2019
1 parent 5d65414 commit ce67eb14ff0739c36deeca6a98cb85e5bebb9d7d
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 ce67eb1

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