summaryrefslogtreecommitdiff
path: root/src/main/python/utils/canvas.py
diff options
context:
space:
mode:
authorBlaine2020-05-06 16:51:02 +0530
committerBlaine2020-05-06 16:51:02 +0530
commit97b304ea746d3ad380fa1ac31409cadc4dbb139b (patch)
tree18c1bc1b275a4b9373bc7db002470a9a8fbadd21 /src/main/python/utils/canvas.py
parent708835a4859a0c5d81a34b26442962e727a0035b (diff)
downloadChemical-PFD-97b304ea746d3ad380fa1ac31409cadc4dbb139b.tar.gz
Chemical-PFD-97b304ea746d3ad380fa1ac31409cadc4dbb139b.tar.bz2
Chemical-PFD-97b304ea746d3ad380fa1ac31409cadc4dbb139b.zip
scroll wheel init
Diffstat (limited to 'src/main/python/utils/canvas.py')
-rw-r--r--src/main/python/utils/canvas.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/python/utils/canvas.py b/src/main/python/utils/canvas.py
index e2e6ab8..640d4cc 100644
--- a/src/main/python/utils/canvas.py
+++ b/src/main/python/utils/canvas.py
@@ -30,7 +30,7 @@ class canvas(QWidget):
self.painter = QGraphicsScene()
self.painter.setBackgroundBrush(QBrush(Qt.white)) #set white background
- self.view = QGraphicsView(self.painter) #create a viewport for the canvas board
+ self.view = graphics.customView(self.painter, self) #create a viewport for the canvas board
self.layout = QHBoxLayout(self) #create the layout of the canvas, the canvas could just subclass QGView instead
self.layout.addWidget(self.view, alignment=Qt.AlignCenter)
@@ -69,7 +69,7 @@ class canvas(QWidget):
#if view is visible use half of available width
factor = 2 if self.parentFileWindow.sideViewTab is not None else 1
#use minimum width required to fit the view
- width = min((prect.width() - 20)//factor, width)
+ width = min((prect.width() - 40)//factor, width)
height = min(prect.height() - 80, height)
#set view dims
self.view.setFixedWidth(width)