From b89efa5b8dcc58b66167d66f2fec188aa34968ca Mon Sep 17 00:00:00 2001 From: benfry Date: Wed, 19 Nov 2008 17:50:43 +0000 Subject: [PATCH] fix text(char, x, y) with textAlignY --- core/src/processing/core/PGraphics.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 3f5cc8eef..e0f927c72 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -2738,6 +2738,16 @@ public class PGraphics extends PImage implements PConstants { if (textMode == SCREEN) loadPixels(); + if (textAlignY == CENTER) { + y += textAscent() / 2; + } else if (textAlignY == TOP) { + y += textAscent(); + } else if (textAlignY == BOTTOM) { + y -= textDescent(); + //} else if (textAlignY == BASELINE) { + // do nothing + } + textBuffer[0] = c; textLineAlignImpl(textBuffer, 0, 1, x, y);