Index: trunk/src/libcschem/cnc_grp.c =================================================================== --- trunk/src/libcschem/cnc_grp.c (revision 2057) +++ trunk/src/libcschem/cnc_grp.c (revision 2058) @@ -115,7 +115,7 @@ } dst->x = src->x; dst->y = src->y; - dst->rot = src->rot; + dst->spec_rot = src->spec_rot; return csch_cgrp_dup_into(sheet, dst, src, 1); } @@ -159,8 +159,8 @@ grp->xform = g2d_xform_mirrory(grp->xform); if (grp->miry) grp->xform = g2d_xform_mirrorx(grp->xform); - if (grp->rot != 0) - grp->xform = g2d_xform_rotate(grp->xform, -grp->rot / RND_RAD_TO_DEG); + if (grp->spec_rot != 0) + grp->xform = g2d_xform_rotate(grp->xform, -grp->spec_rot / RND_RAD_TO_DEG); } void csch_cgrp_role_update(csch_sheet_t *sheet, csch_cgrp_t *grp) @@ -419,7 +419,7 @@ { csch_cgrp_t *cgrp = (csch_cgrp_t *)obj; csch_coord_t nx = cgrp->x, ny = cgrp->y; - double nrot = cgrp->rot + da * cgrp_rotdir(cgrp); + double nrot = cgrp->spec_rot + da * cgrp_rotdir(cgrp); double cs = cos(da), sn = sin(da); csch_rotate_pt(&nx, &ny, rcx, rcy, cs, sn); @@ -431,7 +431,7 @@ { csch_cgrp_t *cgrp = (csch_cgrp_t *)obj; csch_coord_t nx = cgrp->x, ny = cgrp->y; - double nrot = fmod(cgrp->rot + (double)n * 90.0 * cgrp_rotdir(cgrp), 360.0); + double nrot = fmod(cgrp->spec_rot + (double)n * 90.0 * cgrp_rotdir(cgrp), 360.0); csch_rotate90_pt(&nx, &ny, rcx, rcy, n); @@ -472,7 +472,7 @@ csch_cgrp_t *grp; /* it is safe to save the object pointer because it is persistent (through the removed object list) */ unsigned mirx:1, miry:1; - double rot; + double spec_rot; csch_coord_t x, y; } undo_cgrp_modify_t; @@ -487,7 +487,7 @@ rnd_swap(csch_coord_t, u->y, u->grp->y); rnd_swap(int, u->mirx, u->grp->mirx); rnd_swap(int, u->miry, u->grp->miry); - rnd_swap(double, u->rot, u->grp->rot); + rnd_swap(double, u->spec_rot, u->grp->spec_rot); csch_cgrp_update(u->grp->hdr.sheet, u->grp, 1); csch_sheet_set_changed(u->grp->hdr.sheet, 1); @@ -512,7 +512,7 @@ }; -void csch_cgrp_modify(csch_sheet_t *sheet, csch_cgrp_t *grp, csch_coord_t *x, csch_coord_t *y, double *rot, int *mirx, int *miry, int undoable, int relative) +void csch_cgrp_modify(csch_sheet_t *sheet, csch_cgrp_t *grp, csch_coord_t *x, csch_coord_t *y, double *spec_rot, int *mirx, int *miry, int undoable, int relative) { undo_cgrp_modify_t utmp, *u = &utmp; @@ -521,7 +521,7 @@ u->grp = grp; u->x = CSCH_UNDO_RMODIFY(grp, x); u->y = CSCH_UNDO_RMODIFY(grp, y); - u->rot = CSCH_UNDO_RMODIFY(grp, rot); + u->spec_rot = CSCH_UNDO_RMODIFY(grp, spec_rot); u->mirx = CSCH_UNDO_MODIFY(grp, mirx); u->miry = CSCH_UNDO_MODIFY(grp, miry); Index: trunk/src/libcschem/cnc_text.c =================================================================== --- trunk/src/libcschem/cnc_text.c (revision 2057) +++ trunk/src/libcschem/cnc_text.c (revision 2058) @@ -83,7 +83,8 @@ csch_text_t *dst = csch_text_alloc(sheet, parent, CSCH_KEEP_OID(parent, src->hdr.oid)); dst->spec1 = src->spec1; dst->spec2 = src->spec2; - dst->rot = src->rot; + dst->spec_rot = src->spec_rot; + dst->inst_rot = src->inst_rot; dst->has_bbox = src->has_bbox; dst->halign = src->halign; dst->text = rnd_strdup(src->text); @@ -154,8 +155,8 @@ text->inst25 = text->spec25; /* ... then add local text rotation keeping x1;y1 in place */ - if (text->rot != 0) { - double rot = -fmod(text->rot, 360.0) / RND_RAD_TO_DEG; + if (text->inst_rot != 0) { + double rot = -fmod(text->inst_rot, 360.0) / RND_RAD_TO_DEG; double cs = cos(rot); double sn = sin(rot); csch_rotate_pt(&text->inst2.x, &text->inst2.y, text->inst1.x, text->inst1.y, cs, sn); @@ -230,7 +231,7 @@ static void text_rotate(csch_sheet_t *sheet, csch_chdr_t *obj, csch_coord_t rcx, csch_coord_t rcy, double da, int undoable) { csch_text_t *text = (csch_text_t *)obj; - double rot = fmod(text->rot - da, 360.0); + double rot = fmod(text->spec_rot - da, 360.0); csch_coord_t sx = text->spec2.x - text->spec1.x, sy = text->spec2.y - text->spec1.y; csch_coord_t x1 = text->spec1.x, y1 = text->spec1.y, x2, y2; @@ -243,7 +244,7 @@ static void text_rotate90(csch_sheet_t *sheet, csch_chdr_t *obj, csch_coord_t rcx, csch_coord_t rcy, int n, int undoable) { csch_text_t *text = (csch_text_t *)obj; - double rot = fmod(text->rot + (double)n * 90.0, 360.0); + double rot = fmod(text->spec_rot + (double)n * 90.0, 360.0); csch_coord_t sx = text->spec2.x - text->spec1.x, sy = text->spec2.y - text->spec1.y; csch_coord_t x1 = text->spec1.x, y1 = text->spec1.y, x2, y2; @@ -257,7 +258,7 @@ csch_text_t *text = (csch_text_t *)obj; csch_coord_t x1 = text->spec1.x, y1 = text->spec1.y; csch_coord_t x2 = text->spec2.x, y2 = text->spec2.y; - double nrot = text->rot; + double nrot = text->spec_rot; csch_mirror_pt(&x1, &y1, mcx, mcy, mirx, miry); csch_mirror_pt(&x2, &y2, mcx, mcy, mirx, miry); @@ -264,8 +265,8 @@ if (x1 > x2) rnd_swap(csch_coord_t, x1, x2); if (y1 > y2) rnd_swap(csch_coord_t, y1, y2); - if (text->rot != 0) { - double rot = text->rot / RND_RAD_TO_DEG; + if (text->spec_rot != 0) { + double rot = text->spec_rot / RND_RAD_TO_DEG; double sx = cos(rot), sy = sin(rot); if (mirx) sx = -sx; if (miry) sy = -sy; @@ -286,7 +287,7 @@ typedef struct { csch_text_t *texto; /* it is safe to save the object pointer because it is persistent (through the removed object list) */ g2d_vect_t spec1, spec2; - double rot; + double spec_rot; csch_halign_t halign; char *text; unsigned has_bbox:1; @@ -302,7 +303,7 @@ rnd_swap(g2d_vect_t, u->spec1, u->texto->spec1); rnd_swap(g2d_vect_t, u->spec2, u->texto->spec2); - rnd_swap(double, u->rot, u->texto->rot); + rnd_swap(double, u->spec_rot, u->texto->spec_rot); rnd_swap(csch_halign_t, u->halign, u->texto->halign); rnd_swap(char *, u->text, u->texto->text); rnd_swap(int, u->has_bbox, u->texto->has_bbox); @@ -348,7 +349,7 @@ void csch_text_modify(csch_sheet_t *sheet, csch_text_t *texto, csch_coord_t *x1, csch_coord_t *y1, csch_coord_t *x2, csch_coord_t *y2, - double *rot, csch_halign_t *halign, const char **text_, int *has_bbox, int *dyntext, + double *spec_rot, csch_halign_t *halign, const char **text_, int *has_bbox, int *dyntext, int undoable, int relative) { undo_text_modify_t utmp, *u = &utmp; @@ -366,7 +367,7 @@ u->spec1.y = (y1 == NULL) ? texto->spec1.y : (relative ? (texto->spec1.y + *y1) : *y1); u->spec2.x = (x2 == NULL) ? texto->spec2.x : (relative ? (texto->spec2.x + *x2) : *x2); u->spec2.y = (y2 == NULL) ? texto->spec2.y : (relative ? (texto->spec2.y + *y2) : *y2); - u->rot = CSCH_UNDO_RMODIFY(texto, rot); + u->spec_rot = CSCH_UNDO_RMODIFY(texto, spec_rot); u->halign = CSCH_UNDO_MODIFY(texto, halign); u->text = CSCH_UNDO_MODIFY(texto, text); u->has_bbox = CSCH_UNDO_MODIFY(texto, has_bbox); Index: trunk/src/libcschem/cnc_text.h =================================================================== --- trunk/src/libcschem/cnc_text.h (revision 2057) +++ trunk/src/libcschem/cnc_text.h (revision 2058) @@ -49,7 +49,8 @@ typedef struct csch_text_s { csch_chdr_t hdr; g2d_vect_t spec1, spec2; /* x1,y1 and x2,y2 as specified */ - double rot; + double spec_rot; /* rotation, as specified */ + double inst_rot; /* instance rotation (with all transformations) */ csch_halign_t halign; char *text; /* DO NOT USE: in case of dyntext this is only the template, see rtext below; call csch_text_get_rtext() instead */ unsigned has_bbox:1; /* x2 and y2 are specified; when 0, spec2 is calculated and not saved */ Index: trunk/src/libcschem/concrete.h =================================================================== --- trunk/src/libcschem/concrete.h (revision 2057) +++ trunk/src/libcschem/concrete.h (revision 2058) @@ -133,7 +133,7 @@ } ref; } data; - double rot; + double spec_rot; csch_coord_t x, y; unsigned mirx:1, miry:1; Index: trunk/src/plugins/io_lihata/read.c =================================================================== --- trunk/src/plugins/io_lihata/read.c (revision 2057) +++ trunk/src/plugins/io_lihata/read.c (revision 2058) @@ -746,7 +746,7 @@ - if (parse_angle(ctx, &text->rot, lht_dom_hash_get(subtree, "rot")) != 0) + if (parse_angle(ctx, &text->spec_rot, lht_dom_hash_get(subtree, "rot")) != 0) return -1; if (parse_halign(ctx, &text->halign, lht_dom_hash_get(subtree, "halign")) != 0) { error(subtree, ("wrong halign in text object\n")); @@ -825,7 +825,7 @@ return -1; if (parse_coord(ctx, &grp->y, lht_dom_hash_get(subtree, "y")) != 0) return -1; - if (parse_double(ctx, &grp->rot, lht_dom_hash_get(subtree, "rot")) != 0) + if (parse_double(ctx, &grp->spec_rot, lht_dom_hash_get(subtree, "rot")) != 0) return -1; if (parse_bool(ctx, &itmp, lht_dom_hash_get(subtree, "mirx"), subtree, 0) != 0) @@ -881,7 +881,7 @@ return -1; if (parse_coord(ctx, &grp->y, lht_dom_hash_get(subtree, "y")) != 0) return -1; - if (parse_double(ctx, &grp->rot, lht_dom_hash_get(subtree, "rot")) != 0) + if (parse_double(ctx, &grp->spec_rot, lht_dom_hash_get(subtree, "rot")) != 0) return -1; if (parse_oidpath(ctx, &grp->data.ref.ref_str, lht_dom_hash_get(subtree, "ref")) != 0) return -1; Index: trunk/src/plugins/io_lihata/write.c =================================================================== --- trunk/src/plugins/io_lihata/write.c (revision 2057) +++ trunk/src/plugins/io_lihata/write.c (revision 2058) @@ -268,8 +268,8 @@ if (text->has_bbox) fprintf(ctx->f, " x2=%ld; y2=%ld;", text->spec2.x, text->spec2.y); - if (text->rot != 0) - fprintf(ctx->f, " rot=%f;", text->rot); + if (text->spec_rot != 0) + fprintf(ctx->f, " rot=%f;", text->spec_rot); if (text->halign != CSCH_HALIGN_LEFT) fprintf(ctx->f, " halign=%s;", csch_halign2str(text->halign)); @@ -415,9 +415,9 @@ OPTIND; fprintf(ctx->f, "x=%ld; y=%ld;", grp->x, grp->y); } - if (grp->rot != 0) { + if (grp->spec_rot != 0) { OPTIND; - fprintf(ctx->f, "rot=%f;", grp->rot); + fprintf(ctx->f, "rot=%f;", grp->spec_rot); } if (grp->mirx) { OPTIND; Index: trunk/src/plugins/propedit/propsel.c =================================================================== --- trunk/src/plugins/propedit/propsel.c (revision 2057) +++ trunk/src/plugins/propedit/propsel.c (revision 2058) @@ -175,7 +175,7 @@ { map_common_properites(ctx, &text->hdr); map_add_prop(ctx, "p/stroke", pen, text->hdr.stroke_name); - map_add_prop(ctx, "p/text/rot", double, text->rot); + map_add_prop(ctx, "p/text/rot", double, text->spec_rot); map_add_prop_exec(ctx, "p/text/halign", enum, text->halign, prp->enum_names = csch_halign_names); map_add_prop(ctx, "p/text/text", String, text->text); map_add_prop(ctx, "p/text/dyntext", bool, text->dyntext); @@ -204,7 +204,7 @@ TODO("recurse"); map_common_properites(ctx, &grp->hdr); - map_add_prop(ctx, "p/grp/rot", double, grp->rot); + map_add_prop(ctx, "p/grp/rot", double, grp->spec_rot); map_add_prop(ctx, "p/grp/mirx", bool, grp->mirx); map_add_prop(ctx, "p/grp/miry", bool, grp->miry); if (ctx->geo) { Index: trunk/src/sch-rnd/font.c =================================================================== --- trunk/src/sch-rnd/font.c (revision 2057) +++ trunk/src/sch-rnd/font.c (revision 2058) @@ -202,7 +202,7 @@ if (t->pixmap == NULL) { ttf2bbox_pixmap_t *tpm; - double rot = t->rot / RND_RAD_TO_DEG; + double rot = t->inst_rot / RND_RAD_TO_DEG; double cs = cos(rot), sn = sin(rot); const char *text_str;