summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilefont.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/tilefont.cc')
-rw-r--r--crawl-ref/source/tilefont.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/crawl-ref/source/tilefont.cc b/crawl-ref/source/tilefont.cc
index d8cec9c22f..e7e7bde04d 100644
--- a/crawl-ref/source/tilefont.cc
+++ b/crawl-ref/source/tilefont.cc
@@ -576,7 +576,8 @@ void FTFont::render_string(unsigned int px, unsigned int py,
unsigned char font_colour, bool drop_shadow,
unsigned char box_alpha,
unsigned char box_colour,
- unsigned int outline)
+ unsigned int outline,
+ bool tooltip)
{
ASSERT(text);
@@ -626,13 +627,22 @@ void FTFont::render_string(unsigned int px, unsigned int py,
int wx = string_width(text);
int wy = max_rows * char_height();
- // text starting location
- int tx = px - wx / 2;
- int ty = py - wy - outline;
+ int sx, sy; // box starting location, uses extra buffer
+ int tx, ty; // text starting location
- // box with extra buffer to test against min_pos/max_pos window size
- int sx = tx - buffer;
- int sy = ty - buffer;
+ tx = px - wx / 2;
+ sx = tx - buffer;
+ if (tooltip)
+ {
+ sy = py + outline;
+ ty = sy + buffer;
+ }
+ else
+ {
+ ty = py - wy - outline;
+ sy = ty - buffer;
+ }
+ // box ending position
int ex = tx + wx + buffer;
int ey = ty + wy + buffer;