Index: trunk/src/undo_old.c =================================================================== --- trunk/src/undo_old.c (revision 19601) +++ trunk/src/undo_old.c (revision 19602) @@ -88,6 +88,7 @@ static pcb_bool UndoFlag(UndoListTypePtr); static pcb_bool UndoOtherSide(UndoListTypePtr); static pcb_bool UndoChangeSize(UndoListTypePtr); +static pcb_bool UndoChange2ndSize(UndoListTypePtr); static pcb_bool UndoChangeAngles(UndoListTypePtr); static pcb_bool UndoChangeRadii(UndoListTypePtr); static pcb_bool UndoChangeClearSize(UndoListTypePtr); @@ -334,6 +335,29 @@ } /* --------------------------------------------------------------------------- + * recovers an object from a 2nd Size change operation + */ +static pcb_bool UndoChange2ndSize(UndoListTypePtr Entry) +{ + void *ptr1, *ptr2, *ptr3; + int type; + pcb_coord_t swap; + + /* lookup entry by ID */ + type = pcb_search_obj_by_id(PCB->Data, &ptr1, &ptr2, &ptr3, Entry->ID, Entry->Kind); + + if (type == PCB_OBJ_TEXT) { /* thickness */ + swap = ((pcb_text_t *)ptr2)->thickness; + pcb_text_pre((pcb_text_t *)ptr2); + ((pcb_text_t *)ptr2)->thickness = Entry->Data.Size; + Entry->Data.Size = swap; + pcb_text_post((pcb_text_t *)ptr2); + return pcb_true; + } + return pcb_false; +} + +/* --------------------------------------------------------------------------- * recovers an object from a Size change operation */ static pcb_bool UndoChangeRot(UndoListTypePtr Entry) @@ -832,6 +856,11 @@ return 0; break; + case PCB_UNDO_CHANGE2SIZE: + if (UndoChange2ndSize(ptr)) + return 0; + break; + case PCB_UNDO_CHANGEROT: if (UndoChangeRot(ptr)) return 0; @@ -1152,7 +1181,7 @@ UndoListTypePtr undo; if (!Locked) { - undo = GetUndoSlot(PCB_UNDO_CHANGESIZE, PCB_OBJECT_ID(ptr2), Type); + undo = GetUndoSlot(PCB_UNDO_CHANGE2SIZE, PCB_OBJECT_ID(ptr2), Type); switch (Type) { case PCB_OBJ_TEXT: undo->Data.Size = ((pcb_text_t *) ptr2)->thickness; Index: trunk/src/undo_old.h =================================================================== --- trunk/src/undo_old.h (revision 19601) +++ trunk/src/undo_old.h (revision 19602) @@ -87,7 +87,8 @@ PCB_UNDO_CHANGERADII = 0x200000, /* change arc radii */ PCB_UNDO_OTHERSIDE = 0x400000, /* change side of board (subcircuit) */ PCB_UNDO_ROTATE = 0x800000, /* rotations at arbitrary angle */ - PCB_UNDO_CHANGEROT = 0x1000000 /* change internal/self rotation of an object */ + PCB_UNDO_CHANGEROT = 0x1000000, /* change internal/self rotation of an object */ + PCB_UNDO_CHANGE2SIZE = 0x2000000 /* change 2nd size of object */ } pcb_undo_op_t; const char *undo_type2str(int type);