|
@@ -983,11 +983,16 @@ class BufferedWindow(MapWindow, wx.Window):
|
|
|
Debug.msg (5, "BufferedWindow.MouseAction(): wheel=%d" % wheel)
|
|
|
# zoom 1/2 of the screen (TODO: settings)
|
|
|
if zoomBehaviour == 0: # zoom and recenter
|
|
|
- # TODO: fix zooming out
|
|
|
- begin = (current[0] - self.Map.width / 4,
|
|
|
- current[1] - self.Map.height / 4)
|
|
|
- end = (current[0] + self.Map.width / 4,
|
|
|
- current[1] + self.Map.height / 4)
|
|
|
+ if wheel > 0:
|
|
|
+ begin = (current[0] - self.Map.width / 4,
|
|
|
+ current[1] - self.Map.height / 4)
|
|
|
+ end = (current[0] + self.Map.width / 4,
|
|
|
+ current[1] + self.Map.height / 4)
|
|
|
+ else:
|
|
|
+ begin = ((self.Map.width - current[0]) / 2,
|
|
|
+ (self.Map.height - current[1]) / 2)
|
|
|
+ end = (begin[0] + self.Map.width / 2,
|
|
|
+ begin[1] + self.Map.height / 2)
|
|
|
elif zoomBehaviour == 1: # zoom to current cursor position
|
|
|
begin = (current[0]/2, current[1]/2)
|
|
|
end = ((self.Map.width - current[0])/2 + current[0],
|