Add labelOffsetAdjustment to Mechanics.Angle.draw().
authorW. Trevor King <wking@drexel.edu>
Thu, 13 Jan 2011 12:24:40 +0000 (07:24 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 13 Jan 2011 12:24:40 +0000 (07:24 -0500)
For situations where the automatic positioning needs manual tweaking.

asymptote/Mechanics.asy

index 34360ff37b502759d823f50672ad3c87a1f6de67..8bf8bf36f8c80947d517f484e3b946f50e8d4076 100644 (file)
@@ -219,7 +219,8 @@ struct Angle {
     this.L = L;
   }
   
-  void draw(picture pic=currentpicture, bool rotateLabel=false) {
+  void draw(picture pic=currentpicture, bool rotateLabel=false,
+           real labelOffsetAdjustment=0) {
     picture picF;
     picture picL;
     bool direction;
@@ -246,7 +247,7 @@ struct Angle {
     draw(picF, p, outline);    
     label(pic = picF,
          L = rotate(degrees(label_rotate)) * L,
-         position = P + unit(P) * pLabelSize.y / 2);
+         position = P + unit(P) * (pLabelSize.y / 2 + labelOffsetAdjustment));
     add(pic, picF, A);
   }
 }