]> mj.ucw.cz Git - leo.git/blobdiff - sym-text.c
Labelling: Rotation computation improved and commented on
[leo.git] / sym-text.c
index 6622fd61fbd2b56b9c769b6be16484a7d2f10a07..159f00ebe911a8a0ae5d828bfc92ea7374ddcab4 100644 (file)
@@ -17,7 +17,6 @@
 #include "osm.h"
 #include "sym.h"
 #include "map.h"
-
 #include "labeller.h"
 
 /*** Fonts ***/
@@ -228,7 +227,6 @@ static void prepare_text_element(struct sym_text *t, struct svg *svg)
 static void sym_text_draw(struct symbol *sym, struct svg *svg)
 {
   struct sym_text *t = (struct sym_text *) sym;
-printf("Drawing %s at [%.2f; %.2f]\n", osm_val_decode(t->text), t->x, t->y);
 
   if (t->next_duplicate)
     {
@@ -449,8 +447,6 @@ static void sym_text_node(struct osm_object *o, struct style_info *si, osm_val_t
       msg(L_DEBUG, "Text <%s> dropped as duplicate", osm_val_decode(text));
       return;
     }
-
-  //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)
@@ -465,18 +461,7 @@ static void sym_text_center(struct osm_object *o, struct style_info *si, osm_val
   st->x -= st->tw / 2;
   st->y += st->th - (st->th + st->td) / 2;
   text_fix_placement(st);
-  if (o->type == OSM_TYPE_WAY && !osm_way_cyclic_p((struct osm_way *) o))
-  {
-    //sym_plan(&st->s, sym_zindex(o, si, 4.9));
-    printf("[Sym] Labelling way %ju with %s\n", o->id, osm_val_decode(st->text));
-    labeller_add_linelabel(&st->s, o, sym_zindex(o, si, 4.9));
-  }
-  else
-  {
-    //sym_plan(&st->s, sym_zindex(o, si, 4.9));
-    printf("[Sym] Labelling area %ju with %s\n", o->id, osm_val_decode(st->text));
-    labeller_add_arealabel(&st->s, o, sym_zindex(o, si, 4.9));
-  }
+  labeller_add_label(&st->s, o, sym_zindex(o, si, 4.9));
 }
 
 static void sym_text_way(struct osm_object *o, struct style_info *si, osm_val_t text)