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

Method to_data_coor

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

Source from the content-addressed store, hash-verified

273 return self.scales[self.scaleidx]
274
275 def to_data_coor(self, x, y):
276 x = (x - self.box[0] - self.imgbox[0])
277 y = (y - self.box[1] - self.imgbox[1])
278 return (x/self.get_scale(), y/self.get_scale())
279
280 def to_panel_coor(self, x, y):
281 x = x * self.get_scale() + self.imgbox[0] + self.box[0]

Callers 3

on_mouseeventMethod · 0.95
on_zoomMethod · 0.80
on_oneMethod · 0.80

Calls 1

get_scaleMethod · 0.95

Tested by

no test coverage detected