Skip to content

Commit 419f687

Browse files
authored
Merge pull request #5366 from malviys/main
Fixing ReferenceError: totalHeight is not defined throw by textAlign(…
2 parents 5614135 + 8369089 commit 419f687

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/p5.Renderer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ p5.Renderer.prototype.text = function(str, x, y, maxWidth, maxHeight) {
269269

270270
switch (this._textBaseline) {
271271
case constants.BOTTOM:
272-
shiftedY = y + (maxHeight - totalHeight);
272+
shiftedY = y + maxHeight;
273273
y = Math.max(shiftedY, y);
274274
break;
275275
case constants.CENTER:
276-
shiftedY = y + (maxHeight - totalHeight) / 2;
276+
shiftedY = y + maxHeight / 2;
277277
y = Math.max(shiftedY, y);
278278
break;
279279
case constants.BASELINE:

0 commit comments

Comments
 (0)