Fix text height

This commit is contained in:
Christopher Chedeau 2020-01-01 22:15:27 -08:00
parent afe6331c61
commit 44ff545219
1 changed files with 1 additions and 4 deletions

View File

@ -93,13 +93,10 @@ function generateDraw(element) {
element.draw = (rc, context) => {
const font = context.font;
context.font = element.font;
const height =
element.measure.actualBoundingBoxAscent +
element.measure.actualBoundingBoxDescent;
context.fillText(
element.text,
element.x,
element.y + 2 * element.measure.actualBoundingBoxAscent - height / 2
element.y + element.measure.actualBoundingBoxAscent
);
context.font = font;
};