|
@@ -1451,20 +1451,23 @@ class PsMapBufferedWindow(wx.Window):
|
|
|
|
|
|
|
|
|
if self.mouse['use'] == 'zoomout':
|
|
|
- zoomFactor = min(rW/cW, rH/cH)
|
|
|
- if rW/rH > cW/cH:
|
|
|
- yView = rect.GetY() - (rW*(cH/cW) - rH)/2
|
|
|
- xView = rect.GetX()
|
|
|
-
|
|
|
- if self.mouse['use'] == 'zoomout':
|
|
|
- x,y = rect.GetX() + (rW-(cW/cH)*rH)/2, rect.GetY()
|
|
|
- xView, yView = -x, -y
|
|
|
- else:
|
|
|
- xView = rect.GetX() - (rH*(cW/cH) - rW)/2
|
|
|
- yView = rect.GetY()
|
|
|
- if self.mouse['use'] == 'zoomout':
|
|
|
- x,y = rect.GetX(), rect.GetY() + (rH-(cH/cW)*rW)/2
|
|
|
- xView, yView = -x, -y
|
|
|
+ zoomFactor = min(rW/cW, rH/cH)
|
|
|
+ try:
|
|
|
+ if rW/rH > cW/cH:
|
|
|
+ yView = rect.GetY() - (rW*(cH/cW) - rH)/2
|
|
|
+ xView = rect.GetX()
|
|
|
+
|
|
|
+ if self.mouse['use'] == 'zoomout':
|
|
|
+ x,y = rect.GetX() + (rW-(cW/cH)*rH)/2, rect.GetY()
|
|
|
+ xView, yView = -x, -y
|
|
|
+ else:
|
|
|
+ xView = rect.GetX() - (rH*(cW/cH) - rW)/2
|
|
|
+ yView = rect.GetY()
|
|
|
+ if self.mouse['use'] == 'zoomout':
|
|
|
+ x,y = rect.GetX(), rect.GetY() + (rH-(cH/cW)*rW)/2
|
|
|
+ xView, yView = -x, -y
|
|
|
+ except ZeroDivisionError:
|
|
|
+ xView, yView = rect.GetX(), rect.GetY()
|
|
|
return zoomFactor, (int(xView), int(yView))
|
|
|
|
|
|
|