MCPcopy Create free account
hub / github.com/Image-Py/imagepy / zoom

Method zoom

imagepy/ui/canvas.py:128–140  ·  view source on GitHub ↗
(self, k, x, y)

Source from the content-addressed store, hash-verified

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

Callers 7

self_fitMethod · 0.95
zoomoutMethod · 0.95
zoominMethod · 0.95
on_zoomMethod · 0.80
on_oneMethod · 0.80
runMethod · 0.80
mouse_downMethod · 0.80

Calls 2

layFunction · 0.85
handleMethod · 0.45

Tested by

no test coverage detected