GUI: Minor offsets fixes in Tooltip and EditTextWidget
This commit is contained in:
parent
9ba3cd594d
commit
c47b204ac3
2 changed files with 6 additions and 4 deletions
|
@ -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,
|
||||
|
|
|
@ -100,7 +100,7 @@ void EditTextWidget::drawWidget() {
|
|||
setTextDrawableArea(r);
|
||||
|
||||
g_gui.theme()->drawText(
|
||||
Common::Rect(_x + 2 + _leftPadding, _y + 2, _x + _leftPadding + getEditRect().width() + 2, _y + _h),
|
||||
Common::Rect(_x + 2 + _leftPadding, _y + 1, _x + _leftPadding + getEditRect().width() + 2, _y + _h),
|
||||
_editString, _state, Graphics::kTextAlignLeft, ThemeEngine::kTextInversionNone,
|
||||
-_editScrollOffset, false, _font, ThemeEngine::kFontColorNormal, true, _textDrawableArea);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue