#include <ucw/lib.h>
#include <ucw/stkstring.h>
+#include <math.h>
#include <stdio.h>
#include <ft2build.h>
#include FT_FREETYPE_H
t->y = sy / nn;
}
- if (t->opacity != 1)
+ bool use_group = 0;
+ bool want_rotate = (fabs(t->rotate) > 1e-5);
+ if (t->opacity != 1 || want_rotate)
{
+ use_group = 1;
svg_push_element(svg, "g");
- svg_set_attr_float(svg, "opacity", t->opacity);
+ if (t->opacity != 1)
+ svg_set_attr_float(svg, "opacity", t->opacity);
+ if (want_rotate)
+ svg_set_attr_format(svg, "transform", "rotate(%.2f %s %s)", -t->rotate, svg_format_dimen(svg, t->x), svg_format_dimen(svg, t->y));
}
if (t->halo_radius)
svg_pop(svg);
#endif
- if (t->opacity != 1)
+ if (use_group)
svg_pop(svg);
}
return;
}
- sym_plan(&st->s, sym_zindex(o, si, 5));
+ //sym_plan(&st->s, sym_zindex(o, si, 5));
}
static void sym_text_center(struct osm_object *o, struct style_info *si, osm_val_t text, double x, double y)
}
else
{
-// sym_plan(&st->s, sym_zindex(o, si, 4.9));
labeller_add_arealabel(&st->s, o, sym_zindex(o, si, 4.9));
}
}