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

Method self_fit

imagepy/ui/canvas.py:111–118  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

109 self.box = [0,0,box[0],box[1]]
110
111 def self_fit(self):
112 #print('self_fit')
113 for i in self.scales[6::-1]:
114 if self.ips.size[1]*i<=self.scrsize[0]*0.9 and\
115 self.ips.size[0]*i<=self.scrsize[1]*0.9:
116 break
117 self.scaleidx = self.scales.index(i)
118 self.zoom(self.scales[self.scaleidx], 0, 0)
119
120 def set_ips(self, ips):
121 samesize = tuple(ips.img.shape[:2]) == self.imgsize

Callers 2

set_ipsMethod · 0.95
on_fitMethod · 0.80

Calls 1

zoomMethod · 0.95

Tested by

no test coverage detected