this.L = L;
}
- void draw(picture pic=currentpicture, bool rotateLabel=true) {
+ void draw(picture pic=currentpicture, bool rotateLabel=true,
+ real labelangle=90, real labeloffset=-1) {
picture picF;
- picture picL;
- label(picL, L);
- pair pLabelSize = 1.2 * (max(picL)-min(picL));
pair pDiff = pTo - pFrom;
+ if (labeloffset == -1) {
+ picture picL;
+ label(picL, L);
+ pair pLabelSize = 1.2 * (max(picL)-min(picL));
+ labeloffset = pLabelSize.y/2;
+ }
path p = (0,0)--pDiff;
pair label_rotate=pDiff;
if (rotateLabel == false)
label(pic = picF,
L = rotate(degrees(label_rotate)) * L,
position = pDiff/2
- + unit(rotate(90)*pDiff) * pLabelSize.y / 2);
+ + unit(rotate(labelangle)*pDiff) * labeloffset);
//label(pic=picF, L = rotate(degrees(label_rotate)) format("%g", pDiff/scale), position = TODO);
add(pic, picF, pFrom+offset*unit(rotate(-90)*pDiff));
}