]> mj.ucw.cz Git - leo.git/blobdiff - sym-text.c
Symbolizers may return copy of symbol
[leo.git] / sym-text.c
index 159f00ebe911a8a0ae5d828bfc92ea7374ddcab4..9f61f7d376443a1d0e3fee0f910e13f40520ca21 100644 (file)
@@ -224,6 +224,16 @@ static void prepare_text_element(struct sym_text *t, struct svg *svg)
     svg_set_attr(svg, "font-style", osm_val_decode(font->style));
 }
 
+static struct symbol * sym_text_copy(struct symbol *sym)
+{
+  struct sym_text *t = (struct sym_text *) sym;
+
+  struct sym_text *new = xmalloc(sizeof(struct sym_text));
+  *new = *t;   // FIXME: Is this OK? with respect to pointer fields...
+
+  return (struct symbol *) new;
+}
+
 static void sym_text_draw(struct symbol *sym, struct svg *svg)
 {
   struct sym_text *t = (struct sym_text *) sym;
@@ -534,6 +544,7 @@ struct symbolizer symbolizer_text = {
   .draw = sym_text_draw,
   .gen = sym_text_gen,
   .init = sym_text_init,
+  .copy = sym_text_copy,
 };
 
 struct sym_text *sym_text_new(struct osm_object *o)