Added centerto() function to Circ.asy.
authorW. Trevor King <wking@drexel.edu>
Wed, 12 Aug 2009 10:58:08 +0000 (06:58 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 17 Sep 2009 16:49:59 +0000 (12:49 -0400)
Syntax is easier than using the .centerto() method when centering one
TwoTerminal on another.

asymptote/Circ.asy

index 268f39f032a9034f65b3a63ab7692fdb7b021f7f..abfe42430dcd028dee02267c7df800307e400314 100644 (file)
@@ -264,6 +264,15 @@ struct TwoTerminal {
   }
 }
 
+void centerto(TwoTerminal reference, TwoTerminal target, real offset=0,
+             bool reverse=false)
+{
+  if (reverse == false)
+    target.centerto(reference.beg, reference.end, offset);
+  else
+    target.centerto(reference.end, reference.beg, offset);
+}
+
 // --- Resistor (Resistencia) ---
 
 real rstlth=2mm;