To remind, shift+drag is (still) zoom in to area.
| ... | ... |
@@ -1614,10 +1614,14 @@ class DotWidget(gtk.DrawingArea): |
| 1614 | 1614 |
rect = self.get_allocation() |
| 1615 | 1615 |
width = abs(x1 - x2) |
| 1616 | 1616 |
height = abs(y1 - y2) |
| 1617 |
- self.zoom_ratio = min( |
|
| 1618 |
- float(rect.width)/float(width), |
|
| 1619 |
- float(rect.height)/float(height) |
|
| 1620 |
- ) |
|
| 1617 |
+ if width == 0 and height == 0: |
|
| 1618 |
+ self.zoom_ratio /= 2 |
|
| 1619 |
+ else: |
|
| 1620 |
+ # TODO: handle case of width or hight == 0 |
|
| 1621 |
+ self.zoom_ratio = min( |
|
| 1622 |
+ float(rect.width)/float(width), |
|
| 1623 |
+ float(rect.height)/float(height) |
|
| 1624 |
+ ) |
|
| 1621 | 1625 |
self.zoom_to_fit_on_resize = False |
| 1622 | 1626 |
self.x = (x1 + x2) / 2 |
| 1623 | 1627 |
self.y = (y1 + y2) / 2 |