Mercurial > hg > openttd
changeset 19410:b326bdfc63d3 draft
(svn r24313) -Fix: Some obiwans wrt. clicking on setting buttons.
author | frosch <frosch@openttd.org> |
---|---|
date | Fri, 01 Jun 2012 15:08:40 +0000 |
parents | 9e09a99aba22 |
children | 89148abbf734 |
files | src/ai/ai_gui.cpp src/newgrf_gui.cpp src/settings_gui.cpp |
diffstat | 3 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -435,7 +435,7 @@ bool bool_item = (config_item.flags & SCRIPTCONFIG_BOOLEAN) != 0; int x = pt.x - wid->pos_x; - if (_current_text_dir == TD_RTL) x = wid->current_x - x; + if (_current_text_dir == TD_RTL) x = wid->current_x - 1 - x; x -= 4; /* One of the arrows is clicked (or green/red rect in case of bool value) */ if (IsInsideMM(x, 0, SETTING_BUTTON_WIDTH)) {
--- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -321,7 +321,7 @@ const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_NP_BACKGROUND); int x = pt.x - wid->pos_x; - if (_current_text_dir == TD_RTL) x = wid->current_x - x; + if (_current_text_dir == TD_RTL) x = wid->current_x - 1 - x; x -= 4; GRFParameterInfo *par_info = (num < this->grf_config->param_info.Length()) ? this->grf_config->param_info[num] : NULL;
--- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1788,7 +1788,7 @@ { if (widget != WID_GS_OPTIONSPANEL) return; - uint btn = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GS_OPTIONSPANEL, SETTINGTREE_TOP_OFFSET - 1); + uint btn = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_GS_OPTIONSPANEL, SETTINGTREE_TOP_OFFSET); if (btn == INT_MAX) return; uint cur_row = 0; @@ -1796,7 +1796,7 @@ if (pe == NULL) return; // Clicked below the last setting of the page - int x = (_current_text_dir == TD_RTL ? this->width - pt.x : pt.x) - SETTINGTREE_LEFT_OFFSET - (pe->level + 1) * LEVEL_WIDTH; // Shift x coordinate + int x = (_current_text_dir == TD_RTL ? this->width - 1 - pt.x : pt.x) - SETTINGTREE_LEFT_OFFSET - (pe->level + 1) * LEVEL_WIDTH; // Shift x coordinate if (x < 0) return; // Clicked left of the entry if ((pe->flags & SEF_KIND_MASK) == SEF_SUBTREE_KIND) {