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 5, 2019
1 parent 62a9d2b commit a697c99c01429463dbdefe4804807c0058679b52
Showing with 2 additions and 2 deletions.
  1. +2 −2 python/plugins/processing/modeler/ModelerDialog.py
@@ -298,8 +298,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)
@@ -314,6 +312,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'):
@@ -549,6 +548,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 a697c99

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