From 44ff5452198fe0cfa49f2e65fd3dfc9f281631aa Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Wed, 1 Jan 2020 22:15:27 -0800 Subject: [PATCH] Fix text height --- src/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 9761811b..4497894e 100644 --- a/src/index.js +++ b/src/index.js @@ -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; };