1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-19 07:01:53 +02:00

eeshow/kicad/delta.c (obj_eq): also reversed wires are equal

This commit is contained in:
Werner Almesberger 2016-08-20 22:09:01 -03:00
parent 27065ad42f
commit d4b06ff3da

View File

@ -241,18 +241,25 @@ static bool obj_eq(const struct sch_obj *a, const struct sch_obj *b,
{ {
if (a->type != b->type) if (a->type != b->type)
return 0; return 0;
if (a->x != b->x || a->y != b->y)
return 0; /* Special treatment because we support direction reversal */
switch (a->type) { if (a->type == sch_obj_wire) {
case sch_obj_wire:
if (a->u.wire.fn != b->u.wire.fn) if (a->u.wire.fn != b->u.wire.fn)
return 0; return 0;
if (a->x == b->x && a->y == b->y &&
a->u.wire.ex == b->u.wire.ex &&
a->u.wire.ey == b->u.wire.ey)
return 1;
if (a->x == b->u.wire.ex && a->y == b->u.wire.ey &&
a->u.wire.ex == b->x && a->u.wire.ey == b->y)
return 1;
return 0;
}
if (a->x != b->x || a->y != b->y) if (a->x != b->x || a->y != b->y)
return 0; return 0;
if (a->u.wire.ex != b->u.wire.ex ||
a->u.wire.ey != b->u.wire.ey) switch (a->type) {
return 0;
return 1;
case sch_obj_junction: case sch_obj_junction:
return 1; return 1;
case sch_obj_noconn: case sch_obj_noconn: