chiark / gitweb /
Fix the Java front end's vertical text positioning when
authorSimon Tatham <anakin@pobox.com>
Sun, 22 Feb 2009 12:02:40 +0000 (12:02 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 22 Feb 2009 12:02:40 +0000 (12:02 +0000)
ALIGN_VNORMAL is in use: ALIGN_VNORMAL indicates that the supplied
y-coordinate denotes the _baseline_ of the text, not its top, so
adding on 'asc' to convert to the baseline is wrong.

This only affects Tents, at present.

[originally from svn r8452]

PuzzleApplet.java

index 23eda81b5dfb5d4cd3849fa26bf2b0a6bb59b294..f401ecf6b7b6fff49c0c04f15e025b892c1f3b04 100644 (file)
@@ -382,8 +382,6 @@ public class PuzzleApplet extends JApplet implements Runtime.CallJavaCB {
                     int asc = fm.getAscent(), desc = fm.getDescent();
                     if ((xarg3 & ALIGN_VCENTRE) != 0)
                         xarg2 += asc - (asc+desc)/2;
-                    else
-                        xarg2 += asc;
                     int wid = fm.stringWidth(text);
                     if ((xarg3 & ALIGN_HCENTRE) != 0)
                         xarg1 -= wid / 2;