[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: pcb: experience with import-schematics



Well, you'll have to help with this then...

The code is in action.c near the end of ActionElementList() :

      er = ElementOrientation (e);
      pe = & PASTEBUFFER->Data->Element[0];
      pr = ElementOrientation (pe);

      mx = e->MarkX;
      my = e->MarkY;

      if (er != pr)
	RotateElementLowLevel (PASTEBUFFER->Data, pe, pe->MarkX, pe->MarkY, (er-pr+4)%4);

      for (i=0; i<MAX_ELEMENTNAMES; i++)
	{
	  pe->Name[i].X = e->Name[i].X - mx;
	  pe->Name[i].Y = e->Name[i].Y - my;
	  pe->Name[i].Direction = e->Name[i].Direction;
	  pe->Name[i].Scale = e->Name[i].Scale;
	}

There's a couple of coordinates in play - the stored location of the
new element, the mark relative to that, the text location relative to
the element, the old element location, and the old element's text
location.


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user