Fix error when adding parameter

This commit is contained in:
Nyall Dawson 2017-06-22 12:21:25 +10:00
parent c0293dce8b
commit df07772a56

View File

@ -522,7 +522,7 @@ class ModelerDialog(BASE, WIDGET):
MARGIN = 20 MARGIN = 20
BOX_WIDTH = 200 BOX_WIDTH = 200
BOX_HEIGHT = 80 BOX_HEIGHT = 80
if len(self.model.parameterComponents() > 0): if len(self.model.parameterComponents()) > 0:
maxX = max([i.position().x() for i in list(self.model.parameterComponents().values())]) maxX = max([i.position().x() for i in list(self.model.parameterComponents().values())])
newX = min(MARGIN + BOX_WIDTH + maxX, self.CANVAS_SIZE - BOX_WIDTH) newX = min(MARGIN + BOX_WIDTH + maxX, self.CANVAS_SIZE - BOX_WIDTH)
else: else: