| 126 | self.self_fit() |
| 127 | |
| 128 | def zoom(self, k, x, y): |
| 129 | # print 'scale', k |
| 130 | k1 = self.oldscale * 1.0 |
| 131 | self.oldscale = k2 = k |
| 132 | self.imgbox[0] = int(self.imgbox[0] + (k1-k2)*x+0.5) |
| 133 | self.imgbox[1] = int(self.imgbox[1] + (k1-k2)*y+0.5) |
| 134 | self.imgbox[2] = int(self.ips.size[1] * k2+0.5) |
| 135 | self.imgbox[3] = int(self.ips.size[0] * k2+0.5) |
| 136 | lay(self.box, self.imgbox) |
| 137 | if self.imgbox[2]<=self.scrsize[0]*0.9 and\ |
| 138 | self.imgbox[3]<=self.scrsize[1]*0.9 and IPy.uimode()=='ij': |
| 139 | self.SetInitialSize((self.imgbox[2], self.imgbox[3])) |
| 140 | if not self.handle is None: self.handle(self.ips, True) |
| 141 | |
| 142 | def move(self, dx, dy): |
| 143 | if self.imgbox[2]<=self.box[2] and self.imgbox[3]<=self.box[3]:return |