Skip to content
Snippets Groups Projects
Commit 5a0d54d0 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Fixed zooming (only on x axis right now)

parent aa28b357
No related branches found
No related tags found
No related merge requests found
...@@ -189,23 +189,27 @@ class OrthoPanel(wx.Panel, props.HasProperties): ...@@ -189,23 +189,27 @@ class OrthoPanel(wx.Panel, props.HasProperties):
newxmin = canvas.xmin + xshift newxmin = canvas.xmin + xshift
newxmax = canvas.xmax + xshift newxmax = canvas.xmax + xshift
newymin = canvas.ymin + xshift newymin = canvas.ymin + yshift
newymax = canvas.ymax + xshift newymax = canvas.ymax + yshift
if newxmin < imgxmin: xshift = newxmin - imgxmin if newxmin < imgxmin:
elif newxmax > imgxmax: xshift = newxmax - imgxmax newxmin = imgxmin
newxmax = imgxmin + abs(canvas.xmax - canvas.xmin)
elif newxmax > imgxmax:
newxmax = imgxmax
newxmin = imgxmax - abs(canvas.xmax - canvas.xmin)
if newymin < imgymin: yshift = newymin - imgymin if newymin < imgymin:
elif newymax > imgymax: yshift = newymax - imgymax newymin = imgymin
newymax = imgymin + abs(canvas.ymax - canvas.ymin)
if xshift != 0: elif newymax > imgymax:
print 'xshift {}'.format(xshift) newymax = imgymax
canvas.xmin = canvas.xmin + xshift newymin = imgymax - abs(canvas.ymax - canvas.ymin)
canvas.xmax = canvas.xmax + xshift
if yshift != 0: canvas.xmin = newxmin
print 'yshift {}'.format(yshift) canvas.xmax = newxmax
canvas.ymin = canvas.ymin + yshift canvas.ymin = newymin
canvas.ymax = canvas.ymax + yshift canvas.ymax = newymax
def _setCanvasPosition(self, ev): def _setCanvasPosition(self, ev):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment