Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion chaco/tools/better_zoom.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ def _do_zoom(self, new_index_factor, new_value_factor):
y = y_map.map_data(location[1])
nexty = y + (cy - y)*(self._value_factor/new_value_factor)

pan_state = PanState((cx,cy), (nextx, nexty))
if self.component.orientation == 'v':
cx, cy = cy, cx
nextx, nexty = nexty, nextx

pan_state = PanState((cx, cy), (nextx, nexty))
zoom_state = ZoomState((self._index_factor, self._value_factor),
(new_index_factor, new_value_factor))

Expand Down Expand Up @@ -125,6 +129,7 @@ def zoom_in(self, factor=0):
return
if self._zoom_limit_reached(new_value_factor, 'x'):
return

self._do_zoom(new_index_factor, new_value_factor)

def zoom_out(self, factor=0):
Expand Down