Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 18985) +++ trunk/src/change.c (revision 18986) @@ -84,6 +84,7 @@ pcb_opfunc_t Change2ndSizeFunctions = { NULL, + pcb_textop_change_2nd_size, NULL, NULL, NULL, @@ -90,7 +91,6 @@ NULL, NULL, NULL, - NULL, pcb_subcop_change_2nd_size, pcb_pstkop_change_2nd_size }; Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 18985) +++ trunk/src/obj_text.c (revision 18986) @@ -433,6 +433,28 @@ return NULL; } +/* changes the thickness of a text object */ +void *pcb_textop_change_2nd_size(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text) +{ + int value = ctx->chgsize.is_absolute ? ctx->chgsize.value : Text->thickness + ctx->chgsize.value; + + if (PCB_FLAG_TEST(PCB_FLAG_LOCK, Text)) + return NULL; + if (value != Text->thickness) { + pcb_undo_add_obj_to_2nd_size(PCB_OBJ_TEXT, Layer, Text, Text); + pcb_text_invalidate_erase(Layer, Text); + pcb_r_delete_entry(Layer->text_tree, (pcb_box_t *) Text); + pcb_poly_restore_to_poly(PCB->Data, PCB_OBJ_TEXT, Layer, Text); + Text->thickness = value; + pcb_text_bbox(pcb_font(PCB, Text->fid, 1), Text); + pcb_r_insert_entry(Layer->text_tree, (pcb_box_t *) Text); + pcb_poly_clear_from_poly(PCB->Data, PCB_OBJ_TEXT, Layer, Text); + pcb_text_invalidate_draw(Layer, Text); + return Text; + } + return NULL; +} + /* sets data of a text object and calculates bounding box; memory must have already been allocated the one for the new string is allocated */ void *pcb_textop_change_name(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text) Index: trunk/src/obj_text_op.h =================================================================== --- trunk/src/obj_text_op.h (revision 18985) +++ trunk/src/obj_text_op.h (revision 18986) @@ -33,6 +33,7 @@ void *pcb_textop_add_to_buffer(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text); void *pcb_textop_move_buffer(pcb_opctx_t *ctx, pcb_layer_t * layer, pcb_text_t * text); void *pcb_textop_change_size(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text); +void *pcb_textop_change_2nd_size(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text); void *pcb_textop_change_name(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text); void *pcb_textop_change_join(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text); void *pcb_textop_set_join(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text); Index: trunk/src/undo_old.c =================================================================== --- trunk/src/undo_old.c (revision 18985) +++ trunk/src/undo_old.c (revision 18986) @@ -1095,9 +1095,27 @@ } } + /* --------------------------------------------------------------------------- * adds an object to the list of objects with Size changes */ +void pcb_undo_add_obj_to_2nd_size(int Type, void *ptr1, void *ptr2, void *ptr3) +{ + UndoListTypePtr undo; + + if (!Locked) { + undo = GetUndoSlot(PCB_UNDO_CHANGESIZE, PCB_OBJECT_ID(ptr2), Type); + switch (Type) { + case PCB_OBJ_TEXT: + undo->Data.Size = ((pcb_text_t *) ptr2)->thickness; + break; + } + } +} + +/* --------------------------------------------------------------------------- + * adds an object to the list of objects with Size changes + */ void pcb_undo_add_obj_to_clear_size(int Type, void *ptr1, void *ptr2, void *ptr3) { UndoListTypePtr undo; Index: trunk/src/undo_old.h =================================================================== --- trunk/src/undo_old.h (revision 18985) +++ trunk/src/undo_old.h (revision 18986) @@ -53,6 +53,7 @@ void pcb_undo_add_obj_to_move_to_layer(int, void *, void *, void *); void pcb_undo_add_obj_to_flag(void *obj); void pcb_undo_add_obj_to_size(int, void *, void *, void *); +void pcb_undo_add_obj_to_2nd_size(int Type, void *ptr1, void *ptr2, void *ptr3); void pcb_undo_add_obj_to_clear_size(int, void *, void *, void *); void pcb_undo_add_obj_to_change_angles(int, void *, void *, void *); void pcb_undo_add_obj_to_change_radii(int, void *, void *, void *);