mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-02 20:34:41 +00:00
(svn r15598) -Fix [FS#2695]: crash when opening viewport while scrolling the map and the mouse 'lands' on the window decoration of the viewport.
This commit is contained in:
parent
f5a07faf87
commit
b1c105e77e
@ -1176,12 +1176,8 @@ public:
|
||||
|
||||
virtual void OnScroll(Point delta)
|
||||
{
|
||||
ViewPort *vp = IsPtInWindowViewport(this, _cursor.pos.x, _cursor.pos.y);
|
||||
|
||||
if (vp == NULL) {
|
||||
_cursor.fix_at = false;
|
||||
_scrolling_viewport = false;
|
||||
}
|
||||
const ViewPort *vp = IsPtInWindowViewport(this, _cursor.pos.x, _cursor.pos.y);
|
||||
if (vp == NULL) return;
|
||||
|
||||
this->viewport->scrollpos_x += ScaleByZoom(delta.x, vp->zoom);
|
||||
this->viewport->scrollpos_y += ScaleByZoom(delta.y, vp->zoom);
|
||||
|
Loading…
Reference in New Issue
Block a user