summaryrefslogtreecommitdiff
path: root/efl/evas/efl.evas_map.pxi
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2017-07-15 17:30:19 +0200
committerDave Andreoli <dave@gurumeditation.it>2017-07-15 17:30:19 +0200
commit26a4c38d670b8f0a55ada9c981f46452bde2ee3e (patch)
tree59607128fcecbe8e33dfbb631dbf2b5294654b8c /efl/evas/efl.evas_map.pxi
parent15b29e3ce88cb90e967140f76d001dc3d46a4c5e (diff)
New 1.20 API: evas.Map.coords_get
Diffstat (limited to 'efl/evas/efl.evas_map.pxi')
-rw-r--r--efl/evas/efl.evas_map.pxi24
1 files changed, 24 insertions, 0 deletions
diff --git a/efl/evas/efl.evas_map.pxi b/efl/evas/efl.evas_map.pxi
index 2e5ade4..bea2407 100644
--- a/efl/evas/efl.evas_map.pxi
+++ b/efl/evas/efl.evas_map.pxi
@@ -394,6 +394,30 @@ cdef class Map(object):
394 evas_map_point_coord_get(self.map, idx, &x, &y, &z) 394 evas_map_point_coord_get(self.map, idx, &x, &y, &z)
395 return (x, y, z) 395 return (x, y, z)
396 396
397 def coords_get(self, double x, double y, int grab):
398 """Apply a map transformation on given coordinate.
399
400 :param x: point x source coordinate
401 :type x: double
402 :param y: point y source coordinate
403 :type y: double
404 :param grab: unknown
405 :type grab: int
406
407 :return: coordinates after transformation by map
408 :rtype: tuple of 2 doubles (mx, my)
409
410 :raise RuntimeError: when interpolation fail
411
412 .. versionadded:: 1.20
413
414 """
415 cdef double mx, my
416 if evas_map_coords_get(self.map, x, y, &mx, &my, grab) == 0:
417 raise(RuntimeError("Map interpolation failed"))
418 else:
419 return (mx, my)
420
397 # 421 #
398 # XXX: Can't use property here since getter has an argument. 422 # XXX: Can't use property here since getter has an argument.
399 # 423 #