aboutsummaryrefslogtreecommitdiff
path: root/gui/Tooltip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/Tooltip.cpp')
-rw-r--r--gui/Tooltip.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp
index 50f10272fb..dfa1d54ec7 100644
--- a/gui/Tooltip.cpp
+++ b/gui/Tooltip.cpp
@@ -49,8 +49,8 @@ void Tooltip::setup(Dialog *parent, Widget *widget, int x, int y) {
const Graphics::Font *tooltipFont = g_gui.theme()->getFont(ThemeEngine::kFontStyleTooltip);
_wrappedLines.clear();
- _w = tooltipFont->wordWrapText(widget->getTooltip(), _maxWidth - 4, _wrappedLines);
- _h = (tooltipFont->getFontHeight() + 2) * _wrappedLines.size();
+ _w = tooltipFont->wordWrapText(widget->getTooltip(), _maxWidth - 4, _wrappedLines) + 4;
+ _h = (tooltipFont->getFontHeight() + 2) * _wrappedLines.size() + 4;
_x = MIN<int16>(parent->_x + x + _xdelta, g_gui.getWidth() - _w - 3);
_y = MIN<int16>(parent->_y + y + _ydelta, g_gui.getHeight() - _h - 3);
@@ -62,9 +62,11 @@ void Tooltip::drawDialog(DrawLayer layerToDraw) {
Dialog::drawDialog(layerToDraw);
+ int16 textX = _x + 3; // including 2px padding and 1px original code shift
+ int16 textY = _y + 3;
for (Common::StringArray::const_iterator i = _wrappedLines.begin(); i != _wrappedLines.end(); ++i, ++num) {
g_gui.theme()->drawText(
- Common::Rect(_x + 1, _y + 1 + num * h, _x + 1 + _w, _y + 1 + (num + 1) * h),
+ Common::Rect(textX, textY + num * h, textX + _w, textY + (num + 1) * h),
*i,
ThemeEngine::kStateEnabled,
Graphics::kTextAlignLeft,