From e31ea7d79da677a7cb752d863cdb8f2942984b4f Mon Sep 17 00:00:00 2001 From: Johanna Ploog Date: Mon, 11 Jan 2010 15:25:50 +0100 Subject: Experimentally draw tool tip below the mouse pointer rather than above. It's a bit less distracting this way and doesn't cover up the inventory header line (description). --- crawl-ref/source/tilefont.cc | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/tilefont.cc') 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; -- cgit v1.2.3-54-g00ecf