Skip to content

Commit bd2b227

Browse files
authored
Merge pull request #7657 from dhowe/dev-2.0
[dev-2.0] fix bug in textAscent/Descent
2 parents cf37090 + a000a7c commit bd2b227

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/type/textCore.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ function textCore(p5, fn) {
315315
*/
316316
Renderer.prototype.textAscent = function (txt = '') {
317317
if (!txt.length) return this.fontAscent();
318-
return this.textDrawingContext().measureText(txt)[prop];
318+
return this.textDrawingContext().measureText(txt).actualBoundingBoxAscent;
319319
};
320320

321321
/**
@@ -334,7 +334,7 @@ function textCore(p5, fn) {
334334
*/
335335
Renderer.prototype.textDescent = function (txt = '') {
336336
if (!txt.length) return this.fontDescent();
337-
return this.textDrawingContext().measureText(txt)[prop];
337+
return this.textDrawingContext().measureText(txt).actualBoundingBoxDescent;
338338
};
339339

340340
/**

0 commit comments

Comments
 (0)