Skip to content

Commit f3aa1a5

Browse files
committed
hack: adjust annotation area for text baseline.
1 parent 19251b0 commit f3aa1a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jspdf.plugin.annotations.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function notEmpty(obj) {
4747
annotationPlugin.installAnnotationPlugin = function(pdf) {
4848

4949
this.annotations = [];
50-
50+
5151
// TODO remove this after we find a way to subscribe before the
5252
// first page is created.
5353
//this.annotations[1] = [];
@@ -125,6 +125,9 @@ function notEmpty(obj) {
125125
var width = this.getTextWidth(text);
126126
var height = this.internal.getLineHeight();
127127
this.text(text, x, y);
128+
//TODO We really need the text baseline height to do this correctly.
129+
// Or ability to draw text on top, bottom, center, or baseline.
130+
y += height * .2;
128131
this.link(x, y - height, width, height, options);
129132
return this;
130133
};

0 commit comments

Comments
 (0)