Index: xy.c =================================================================== --- xy.c (revision 35946) +++ xy.c (revision 35947) @@ -765,6 +765,8 @@ if (sval != NULL) { double r = strtod(sval, &end); while(isspace(*end)) end++; + if (!ctx->front) /* rotation is mirrored on bottom */ + r = -r; if (*end != '\0') rnd_message(RND_MSG_ERROR, "xy: invalid subc rotate (%s) on subc '%s'\n", sval, ((subc->refdes == NULL) ? "" : subc->refdes)); else @@ -847,6 +849,9 @@ if (pcb_subc_get_rotation(subc, &ctx.theta) != 0) rnd_message(RND_MSG_ERROR, "xy: can't get subc rotation for %s\n", ctx.name); if (pcb_subc_get_side(subc, &bott) != 0) rnd_message(RND_MSG_ERROR, "xy: can't get subc side for %s\n", ctx.name); + ctx.subc = subc; + ctx.front = !bott; + xy_xform_by_subc_attrs(&ctx, subc); ctx.theta = -ctx.theta; @@ -853,9 +858,6 @@ if (ctx.theta == -0) ctx.theta = 0; - ctx.subc = subc; - ctx.front = !bott; - xy_translate(&ctx, &ctx.x, &ctx.y, &ctx.bottom_x, &ctx.bottom_y, 1); calc_pad_bbox(&ctx, 0, &ctx.pad_w, &ctx.pad_h, &ctx.pad_cx, &ctx.pad_cy);