From: Martin Mares Date: Mon, 1 Jun 2015 23:28:58 +0000 (+0200) Subject: Added style properties icon-offset-{x,y} X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c766658cd89232da2238aceeebcd4b3cc1b1a8c8;p=leo.git Added style properties icon-offset-{x,y} --- diff --git a/TODO b/TODO index 2977c83..54c3c1a 100644 --- 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-*) diff --git a/dict-props.t b/dict-props.t index a164805..f2132d4 100644 --- a/dict-props.t +++ b/dict-props.t @@ -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 diff --git a/sym-point.c b/sym-point.c index c7c2be0..e8b32d9 100644 --- a/sym-point.c +++ b/sym-point.c @@ -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);