Skip to content

Commit 8369089

Browse files
committed
Fixing ReferenceError: totalHeight is not defined throw by textAlign(___, CENTER) and textAlign(___, BOTTOM)
1 parent 802c7dd commit 8369089

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)