Commits

Yuya Nishihara committed 3e0b0d5

blockmatcher: fix ZeroDivisionError when widget height is nearly zero

Traceback (most recent call last):
File "tortoisehg/hgqt/blockmatcher.py", line 242, in paintEvent
scaler = self._sbar['right'].height()//ps_r
ZeroDivisionError: float divmod()

Comments (0)

Files changed (1)

tortoisehg/hgqt/blockmatcher.py

         self._blocks.add((typ, alo, ahi, blo, bhi))
 
     def paintEvent(self, event):
+        if self._pagestep['left'] == 0 or self._pagestep['right'] == 0:
+            return
+
         w = self.width()
         h = self.height()
         p = QPainter(self)