Index: trunk/src/action.c =================================================================== --- trunk/src/action.c (revision 843) +++ trunk/src/action.c (revision 844) @@ -4051,9 +4051,7 @@ switch (funcid) { case F_Object: switch(type) { - case ELEMENT_TYPE: - if (size_id == 0) /* 1st size is silk line width for some reason - skip it in object mode */ - return -1; + case ELEMENT_TYPE: /* we'd set pin/pad properties, so fall thru */ case VIA_TYPE: case PIN_TYPE: return get_style_size(F_SelectedVias, out, 0, size_id); case PAD_TYPE: return get_style_size(F_SelectedPads, out, 0, size_id); @@ -4121,7 +4119,7 @@ char *units = ARG (2); bool absolute; /* indicates if absolute size is given */ Coord value; - int type; + int type, tostyle = 0; void *ptr1, *ptr2, *ptr3; @@ -4136,6 +4134,7 @@ if (get_style_size(funcid, &value, type, 0) != 0) return 1; absolute = 1; + tostyle = 1; } else value = GetValue (delta, units, &absolute); @@ -4146,11 +4145,16 @@ if (type != NO_TYPE) if (TEST_FLAG (LOCKFLAG, (PinTypePtr) ptr2)) Message (_("Sorry, the object is locked\n")); - if (ChangeObjectSize (type, ptr1, ptr2, ptr3, value, absolute)) - SetChangedFlag (true); + if (tostyle) { + if (ChangeObject1stSize (type, ptr1, ptr2, ptr3, value, absolute)) + SetChangedFlag (true); + } + else { + if (ChangeObjectSize (type, ptr1, ptr2, ptr3, value, absolute)) + SetChangedFlag (true); + } break; } - case F_SelectedVias: if (ChangeSelectedSize (VIA_TYPE, value, absolute)) SetChangedFlag (true); @@ -4319,7 +4323,6 @@ if (get_style_size(funcid, &value, type, 2) != 0) return 1; absolute = 1; - printf("VALUE: %d %d %d\n", value, value*2, Settings.Keepaway); value *= 2; } else Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 843) +++ trunk/src/change.c (revision 844) @@ -73,6 +73,7 @@ static void *ChangePadClearSize (ElementTypePtr, PadTypePtr); static void *ChangePadMaskSize (ElementTypePtr, PadTypePtr); static void *ChangePin2ndSize (ElementTypePtr, PinTypePtr); +static void *ChangeElement1stSize (ElementTypePtr); static void *ChangeElement2ndSize (ElementTypePtr); static void *ChangeViaSize (PinTypePtr); static void *ChangeVia2ndSize (PinTypePtr); @@ -146,6 +147,20 @@ ChangeArcSize, NULL }; +static ObjectFunctionType Change1stSizeFunctions = { + ChangeLineSize, + ChangeTextSize, + ChangePolyClear, + ChangeViaSize, + ChangeElement1stSize, + ChangeElementNameSize, + ChangePinSize, + ChangePadSize, + NULL, + NULL, + ChangeArcSize, + NULL +}; static ObjectFunctionType Change2ndSizeFunctions = { NULL, NULL, @@ -672,6 +687,46 @@ } /* --------------------------------------------------------------------------- + * changes ring dia of all pins of an element + * returns TRUE if changed + */ +static void * +ChangeElement1stSize (ElementTypePtr Element) +{ + bool changed = false; + Coord value; + + if (TEST_FLAG (LOCKFLAG, Element)) + return (NULL); + PIN_LOOP (Element); + { + value = (Absolute) ? Absolute : pin->DrillingHole + Delta; + if (value <= MAX_PINORVIASIZE && + value >= pin->DrillingHole + MIN_PINORVIACOPPER + && value != pin->Thickness) + { + changed = true; + AddObjectTo2ndSizeUndoList (PIN_TYPE, Element, pin, pin); + ErasePin (pin); + RestoreToPolygon (PCB->Data, PIN_TYPE, Element, pin); + pin->Thickness = value; + if (TEST_FLAG (HOLEFLAG, pin)) + { + AddObjectToSizeUndoList (PIN_TYPE, Element, pin, pin); + pin->Thickness = value; + } + ClearFromPolygon (PCB->Data, PIN_TYPE, Element, pin); + DrawPin (pin); + } + } + END_LOOP; + if (changed) + return (Element); + else + return (NULL); +} + +/* --------------------------------------------------------------------------- * changes the clearance of all pins of an element * returns TRUE if changed */ @@ -2143,7 +2198,7 @@ /* --------------------------------------------------------------------------- - * changes the size of the passed object + * changes the size of the passed object; element size is silk size * Returns true if anything is changed */ bool @@ -2166,6 +2221,29 @@ } /* --------------------------------------------------------------------------- + * changes the size of the passed object; element size is pin ring sizes + * Returns true if anything is changed + */ +bool +ChangeObject1stSize (int Type, void *Ptr1, void *Ptr2, void *Ptr3, + Coord Difference, bool fixIt) +{ + bool change; + + /* setup identifier */ + Absolute = (fixIt) ? Difference : 0; + Delta = Difference; + change = + (ObjectOperation (&Change1stSizeFunctions, Type, Ptr1, Ptr2, Ptr3) != NULL); + if (change) + { + Draw (); + IncrementUndoSerialNumber (); + } + return (change); +} + +/* --------------------------------------------------------------------------- * changes the clearance size of the passed object * Returns true if anything is changed */ Index: trunk/src/change.h =================================================================== --- trunk/src/change.h (revision 843) +++ trunk/src/change.h (revision 844) @@ -92,6 +92,7 @@ bool ChangeHole (PinTypePtr); bool ChangePaste (PadTypePtr); bool ChangeObjectSize (int, void *, void *, void *, Coord, bool); +bool ChangeObject1stSize (int, void *, void *, void *, Coord, bool); bool ChangeObjectThermal (int, void *, void *, void *, int); bool ChangeObjectClearSize (int, void *, void *, void *, Coord, bool);