summaryrefslogtreecommitdiff
path: root/graphics/asymptote/base/annotate.asy
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/asymptote/base/annotate.asy
Initial commit
Diffstat (limited to 'graphics/asymptote/base/annotate.asy')
-rw-r--r--graphics/asymptote/base/annotate.asy16
1 files changed, 16 insertions, 0 deletions
diff --git a/graphics/asymptote/base/annotate.asy b/graphics/asymptote/base/annotate.asy
new file mode 100644
index 0000000000..aba9309cb6
--- /dev/null
+++ b/graphics/asymptote/base/annotate.asy
@@ -0,0 +1,16 @@
+void annotate(picture pic=currentpicture, string title, string text,
+ pair position)
+{
+ pic.add(new void(frame f, transform t) {
+ position=t*position;
+ label(f,"\special{!/pdfmark where
+ {pop} {userdict /pdfmark /cleartomark load put} ifelse
+ [/Rect["+(string) position.x+" 0 0 "+(string) position.y+"]
+ /Subtype /Text
+ /Name /Comment
+ /Title ("+title+")
+ /Contents ("+text+")
+ /ANN pdfmark}");
+ },true);
+ draw(pic,position,invisible);
+}