]> mj.ucw.cz Git - leo.git/commitdiff
Added style properties icon-offset-{x,y}
authorMartin Mares <mj@ucw.cz>
Mon, 1 Jun 2015 23:28:58 +0000 (01:28 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 1 Jun 2015 23:28:58 +0000 (01:28 +0200)
TODO
dict-props.t
sym-point.c

diff --git a/TODO b/TODO
index 2977c8326286cc47bf302a580f8c76ff0b21140e..54c3c1ae39878c2dc7c83b9939831864cb9f7e97 100644 (file)
--- a/TODO
+++ b/TODO
@@ -4,3 +4,6 @@
   Does it matter?
 - Fixing of label positions should include some margin
 - Clean up shp.c
+
+- Add icon-anchor-* properties like text-anchor-*
+  (for now, we have only icon-offset-*)
index a164805d9b4c2a11b337e7bccd6b6d13bfb4223a..f2132d45e5300994268119cb7bd19b1fe9bbd1c9 100644 (file)
@@ -15,6 +15,8 @@ font-style
 font-weight
 icon-height
 icon-image
+icon-offset-x
+icon-offset-y
 icon-opacity
 icon-width
 major-z-index
index c7c2be0a01f8c470757ae9416c4dd387f2135e21..e8b32d9a56ac79375f6b08dc536838235607861b 100644 (file)
@@ -130,6 +130,12 @@ static void sym_icon_gen(struct osm_object *o, struct style_info *si, struct svg
   if (!osm_obj_center(o, &sir->x, &sir->y))
     return;
 
+  double dx = 0, dy = 0;
+  style_get_number(si, PROP_ICON_OFFSET_X, &dx);
+  style_get_number(si, PROP_ICON_OFFSET_Y, &dy);
+  sir->x += dx;
+  sir->y += dy;
+
   sir->width = icon->width;
   sir->height = icon->height;
   style_scale(si, &sir->width, &sir->height, PROP_ICON_WIDTH, PROP_ICON_HEIGHT);