Explorar o código

Fix text height

Christopher Chedeau %!s(int64=5) %!d(string=hai) anos
pai
achega
44ff545219
Modificáronse 1 ficheiros con 1 adicións e 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;
     };