Index: trunk/src/copy.c =================================================================== --- trunk/src/copy.c (revision 4554) +++ trunk/src/copy.c (revision 4555) @@ -57,7 +57,6 @@ /* --------------------------------------------------------------------------- * some local identifiers */ -static Coord DeltaX, DeltaY; /* movement vector */ static pcb_opfunc_t CopyFunctions = { CopyLine, CopyText, @@ -162,7 +161,7 @@ { PinTypePtr via; - via = CreateNewVia(PCB->Data, Via->X + DeltaX, Via->Y + DeltaY, + via = CreateNewVia(PCB->Data, Via->X + ctx->copy.DeltaX, Via->Y + ctx->copy.DeltaY, Via->Thickness, Via->Clearance, Via->Mask, Via->DrillingHole, Via->Name, MaskFlags(Via->Flags, PCB_FLAG_FOUND)); if (!via) return (via); @@ -178,10 +177,10 @@ { LineTypePtr line; - line = CreateDrawnLineOnLayer(Layer, Line->Point1.X + DeltaX, - Line->Point1.Y + DeltaY, - Line->Point2.X + DeltaX, - Line->Point2.Y + DeltaY, Line->Thickness, Line->Clearance, MaskFlags(Line->Flags, PCB_FLAG_FOUND)); + line = CreateDrawnLineOnLayer(Layer, Line->Point1.X + ctx->copy.DeltaX, + Line->Point1.Y + ctx->copy.DeltaY, + Line->Point2.X + ctx->copy.DeltaX, + Line->Point2.Y + ctx->copy.DeltaY, Line->Thickness, Line->Clearance, MaskFlags(Line->Flags, PCB_FLAG_FOUND)); if (!line) return (line); if (Line->Number) @@ -198,8 +197,8 @@ { ArcTypePtr arc; - arc = CreateNewArcOnLayer(Layer, Arc->X + DeltaX, - Arc->Y + DeltaY, Arc->Width, Arc->Height, Arc->StartAngle, + arc = CreateNewArcOnLayer(Layer, Arc->X + ctx->copy.DeltaX, + Arc->Y + ctx->copy.DeltaY, Arc->Width, Arc->Height, Arc->StartAngle, Arc->Delta, Arc->Thickness, Arc->Clearance, MaskFlags(Arc->Flags, PCB_FLAG_FOUND)); if (!arc) return (arc); @@ -215,8 +214,8 @@ { TextTypePtr text; - text = CreateNewText(Layer, &PCB->Font, Text->X + DeltaX, - Text->Y + DeltaY, Text->Direction, Text->Scale, Text->TextString, MaskFlags(Text->Flags, PCB_FLAG_FOUND)); + text = CreateNewText(Layer, &PCB->Font, Text->X + ctx->copy.DeltaX, + Text->Y + ctx->copy.DeltaY, Text->Direction, Text->Scale, Text->TextString, MaskFlags(Text->Flags, PCB_FLAG_FOUND)); DrawText(Layer, text); AddObjectToCreateUndoList(PCB_TYPE_TEXT, Layer, text, text); return (text); @@ -231,7 +230,7 @@ polygon = CreateNewPolygon(Layer, NoFlags()); CopyPolygonLowLevel(polygon, Polygon); - MovePolygonLowLevel(polygon, DeltaX, DeltaY); + MovePolygonLowLevel(polygon, ctx->copy.DeltaX, ctx->copy.DeltaY); if (!Layer->polygon_tree) Layer->polygon_tree = r_create_tree(NULL, 0, 0); r_insert_entry(Layer->polygon_tree, (BoxTypePtr) polygon, 0); @@ -253,8 +252,8 @@ ElementTypePtr element = CopyElementLowLevel(PCB->Data, NULL, Element, - conf_core.editor.unique_names, DeltaX, - DeltaY); + conf_core.editor.unique_names, ctx->copy.DeltaX, + ctx->copy.DeltaY); /* this call clears the polygons */ AddObjectToCreateUndoList(PCB_TYPE_ELEMENT, element, element, element); @@ -286,7 +285,9 @@ #endif /* set movement vector */ - DeltaX = X - PASTEBUFFER->X, DeltaY = Y - PASTEBUFFER->Y; + ctx.copy.pcb = PCB; + ctx.copy.DeltaX = X - PASTEBUFFER->X; + ctx.copy.DeltaY = Y - PASTEBUFFER->Y; /* paste all layers */ for (i = 0; i < max_copper_layer + 2; i++) { @@ -364,9 +365,9 @@ void *ptr; pcb_opctx_t ctx; - /* setup movement vector */ - DeltaX = DX; - DeltaY = DY; + ctx.copy.pcb = PCB; + ctx.copy.DeltaX = DX; + ctx.copy.DeltaY = DY; /* the subroutines add the objects to the undo-list */ ptr = ObjectOperation(&CopyFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3); Index: trunk/src/operation.h =================================================================== --- trunk/src/operation.h (revision 4554) +++ trunk/src/operation.h (revision 4555) @@ -62,6 +62,7 @@ typedef struct { PCBType *pcb; + Coord DeltaX, DeltaY; /* movement vector */ } pcb_opctx_copy_t; typedef struct {