Explorar el Código

Fix text height

Christopher Chedeau hace 5 años
padre
commit
44ff545219
Se han modificado 1 ficheros con 1 adiciones y 4 borrados
  1. 1 4
      src/index.js

+ 1 - 4
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;
     };