(self, x, y, lim)
| 10 | self.moving = False |
| 11 | |
| 12 | def snap(self, x, y, lim): |
| 13 | plg = self.plg |
| 14 | if abs(x-plg.lt)<lim and abs(y-(plg.tp+plg.bm)/2)<lim:return 'l' |
| 15 | if abs(x-plg.rt)<lim and abs(y-(plg.tp+plg.bm)/2)<lim:return 'r' |
| 16 | if abs(x-(plg.lt+plg.rt)/2)<lim and abs(y-plg.tp)<lim:return 't' |
| 17 | if abs(x-(plg.lt+plg.rt)/2)<lim and abs(y-plg.bm)<lim:return 'b' |
| 18 | if abs(x-plg.lt)<lim and abs(y-plg.tp)<lim:return 'lt' |
| 19 | if abs(x-plg.rt)<lim and abs(y-plg.bm)<lim:return 'rb' |
| 20 | if abs(x-plg.rt)<lim and abs(y-plg.tp)<lim:return 'rt' |
| 21 | if abs(x-plg.lt)<lim and abs(y-plg.bm)<lim:return 'lb' |
| 22 | if (x-plg.lt)*(x-plg.rt)<0 and (y-plg.tp)*(y-plg.bm)<0: |
| 23 | self.ox, self.oy = x, y |
| 24 | return True |
| 25 | return False |
| 26 | |
| 27 | def mouse_down(self, ips, x, y, btn, **key): |
| 28 | lim = 5.0/key['canvas'].get_scale() |
no outgoing calls
no test coverage detected