(svn r21977) -Codechange: Always cal Window::OnMouseWheel(), independent of viewport scroll/zoom settings.
This commit is contained in:
@@ -1461,12 +1461,14 @@ public:
|
||||
|
||||
virtual void OnMouseWheel(int wheel)
|
||||
{
|
||||
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(SM_WIDGET_MAP);
|
||||
int cursor_x = _cursor.pos.x - this->left - wid->pos_x;
|
||||
int cursor_y = _cursor.pos.y - this->top - wid->pos_y;
|
||||
if (IsInsideMM(cursor_x, 0, wid->current_x) && IsInsideMM(cursor_y, 0, wid->current_y)) {
|
||||
Point pt = {cursor_x, cursor_y};
|
||||
this->SetZoomLevel((wheel < 0) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &pt);
|
||||
if (_settings_client.gui.scrollwheel_scrolling == 0) {
|
||||
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(SM_WIDGET_MAP);
|
||||
int cursor_x = _cursor.pos.x - this->left - wid->pos_x;
|
||||
int cursor_y = _cursor.pos.y - this->top - wid->pos_y;
|
||||
if (IsInsideMM(cursor_x, 0, wid->current_x) && IsInsideMM(cursor_y, 0, wid->current_y)) {
|
||||
Point pt = {cursor_x, cursor_y};
|
||||
this->SetZoomLevel((wheel < 0) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &pt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user