Fix text height

This commit is contained in:
Christopher Chedeau 2020-01-01 22:15:27 -08:00
parent afe6331c61
commit 44ff545219

View File

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