From: W. Trevor King Date: Wed, 12 Aug 2009 10:58:08 +0000 (-0400) Subject: Added centerto() function to Circ.asy. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a4a1ea6e2f386d023b4cad05300100507ad91da2;p=course.git Added centerto() function to Circ.asy. Syntax is easier than using the .centerto() method when centering one TwoTerminal on another. --- diff --git a/asymptote/Circ.asy b/asymptote/Circ.asy index 268f39f..abfe424 100644 --- a/asymptote/Circ.asy +++ b/asymptote/Circ.asy @@ -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;