| 67 | ips.update() |
| 68 | |
| 69 | def mouse_move(self, ips, x, y, btn, **key): |
| 70 | if ips.roi==None:return |
| 71 | lim = 5.0/key['canvas'].get_scale() |
| 72 | if btn==None: |
| 73 | self.cursor = wx.CURSOR_CROSS |
| 74 | if ips.roi.snap(x, y, ips.cur, lim)!=None: |
| 75 | self.cursor = wx.CURSOR_HAND |
| 76 | elif btn==1: |
| 77 | if ips.roi.dtype == 'polygon' and self.doing: |
| 78 | l,b,r,t = self.ox, self.oy, x, y |
| 79 | ar = np.linspace(0, np.pi*2,29) |
| 80 | xs = np.cos(ar)*abs(r-l)/2+(r+l)/2 |
| 81 | ys = np.sin(ar)*abs(t-b)/2+(t+b)/2 |
| 82 | self.helper.buf = [[(x,y) for x,y in zip(xs,ys)],[]] |
| 83 | if self.curobj: ips.roi.draged(self.odx, self.ody, x, y, ips.cur, self.curobj) |
| 84 | ips.update() |
| 85 | self.odx, self.ody = x, y |
| 86 | |
| 87 | def mouse_wheel(self, ips, x, y, d, **key): |
| 88 | pass |