mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r27255) -Fix [FS#6270]: Combined button+dropdown widgets in order and autoreplace GUI had incorrect hitbox when using GUI zoom. (_dp_)
This commit is contained in:
parent
7e12a1a985
commit
2639b84316
|
@ -2524,10 +2524,10 @@ void NWidgetLeaf::Draw(const Window *w)
|
||||||
bool NWidgetLeaf::ButtonHit(const Point &pt)
|
bool NWidgetLeaf::ButtonHit(const Point &pt)
|
||||||
{
|
{
|
||||||
if (_current_text_dir == TD_LTR) {
|
if (_current_text_dir == TD_LTR) {
|
||||||
int button_width = this->pos_x + this->current_x - 12;
|
int button_width = this->pos_x + this->current_x - NWidgetLeaf::dropdown_dimension.width;
|
||||||
return pt.x < button_width;
|
return pt.x < button_width;
|
||||||
} else {
|
} else {
|
||||||
int button_left = this->pos_x + 12;
|
int button_left = this->pos_x + NWidgetLeaf::dropdown_dimension.width;
|
||||||
return pt.x >= button_left;
|
return pt.x >= button_left;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue