140 |
class ZoomOutTool(RectTool): |
class ZoomOutTool(RectTool): |
141 |
|
|
142 |
"""The Zoom-Out Tool""" |
"""The Zoom-Out Tool""" |
143 |
|
|
144 |
def Name(self): |
def Name(self): |
145 |
return "ZoomOutTool" |
return "ZoomOutTool" |
146 |
|
|
151 |
cx, cy = self.current |
cx, cy = self.current |
152 |
if sx == cx and sy == cy: |
if sx == cx and sy == cy: |
153 |
# Just a mouse click. Simply zoom out by a factor of two |
# Just a mouse click. Simply zoom out by a factor of two |
154 |
self.view.ZoomFactor(0.5, center = (cy, cy)) |
self.view.ZoomFactor(0.5, center = (cx, cy)) |
155 |
else: |
else: |
156 |
# A drag. Zoom out to the rectangle |
# A drag. Zoom out to the rectangle |
157 |
self.view.ZoomOutToRect((min(sx, cx), min(sy, cy), |
self.view.ZoomOutToRect((min(sx, cx), min(sy, cy), |