if (((other->n1->id == node->id) || (other->n2->id == node->id)) &&
(e->label) && (other->label) &&
- (e->label->type == SYMBOLIZER_TEXT) && (other->label->type == SYMBOLIZER_TEXT) &&
- (((struct sym_text *) e->label)->text == ((struct sym_text *) other->label)->text))
+ (sym_look_same(e->label, other->label)))
{
if (! candidate || (other->length > candidate->length))
candidate = other;
return (struct symbol *) new;
}
+static bool sym_text_look_same(struct symbol *s1, struct symbol *s2)
+{
+ struct sym_text *st1 = (struct sym_text *) s1;
+ struct sym_text *st2 = (struct sym_text *) s2;
+ return (st1->text == st2->text && st1->text_color == st2->text_color);
+}
+
static void sym_text_draw(struct symbol *sym, struct svg *svg)
{
struct sym_text *t = (struct sym_text *) sym;
.gen = sym_text_gen,
.init = sym_text_init,
.copy = sym_text_copy,
+ .look_same = sym_text_look_same,
};
struct sym_text *sym_text_new(struct osm_object *o)
else
return NULL;
}
+
+bool sym_look_same(struct symbol *s1, struct symbol *s2)
+{
+ if (s1->type != s2->type)
+ return false;
+
+ ASSERT(s1->type && s1->type < SYMBOLIZER_MAX);
+ if (symbolizers[s1->type]->look_same)
+ return symbolizers[s1->type]->look_same(s1, s2);
+ else
+ return false;
+}
void (*gen)(struct osm_object *o, struct style_info *si, struct svg *svg);
void (*init)(void);
struct symbol* (*copy)(struct symbol *sym);
+ bool (*look_same)(struct symbol *s1, struct symbol *s2);
};
extern struct mempool *sym_mp;
z_index_t sym_zindex(struct osm_object *o, struct style_info *si, double default_mzi);
struct symbol * sym_copy(struct symbol *sym);
+bool sym_look_same(struct symbol *s1, struct symbol *s2);
/* sym-point.c handles point symbols and icons */