From f0d6cd5a97593003fcca3c800ede409f6c55344c Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Fri, 6 Feb 2009 08:58:58 -0700 Subject: While this is not the ideal solution to the link problem, this commit at least ensures that the link will be in the correct location. Should work to fix things until a proper rewrite is figured out. Signed-off-by: Ira Rice --- src/gui/browserbox.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp index c51852bb..ecc22e5f 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -276,6 +276,7 @@ void BrowserBox::draw(gcn::Graphics *graphics) int x = 0, y = 0; int wrappedLines = 0; + int link = 0; TrueTypeFont *font = static_cast(getFont()); graphics->setColor(BLACK); @@ -333,6 +334,12 @@ void BrowserBox::draw(gcn::Graphics *graphics) int rgb = textColour->getColour(c, valid); if (c == '<') { + const int size = mLinks[link].x2 - mLinks[link].x1; + mLinks[link].x1 = x; + mLinks[link].y1 = y; + mLinks[link].x2 = mLinks[link].x1 + size; + mLinks[link].y2 = y + font->getHeight(); + link++; prevColor = selColor; } if (valid) -- cgit v1.2.3-70-g09d2