From a000a7c8ea9c4e072663cecf293fddb1ef8f76af Mon Sep 17 00:00:00 2001 From: dhowe Date: Sat, 22 Mar 2025 23:40:32 +0000 Subject: [PATCH] fix bugs in textAscent/Descent --- src/type/textCore.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/type/textCore.js b/src/type/textCore.js index ef25a7e5aa..d76033b5c6 100644 --- a/src/type/textCore.js +++ b/src/type/textCore.js @@ -315,7 +315,7 @@ function textCore(p5, fn) { */ Renderer.prototype.textAscent = function (txt = '') { if (!txt.length) return this.fontAscent(); - return this.textDrawingContext().measureText(txt)[prop]; + return this.textDrawingContext().measureText(txt).actualBoundingBoxAscent; }; /** @@ -334,7 +334,7 @@ function textCore(p5, fn) { */ Renderer.prototype.textDescent = function (txt = '') { if (!txt.length) return this.fontDescent(); - return this.textDrawingContext().measureText(txt)[prop]; + return this.textDrawingContext().measureText(txt).actualBoundingBoxDescent; }; /**