mirror of https://github.com/OpenTTD/OpenTTD.git
(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)
|
virtual void OnScroll(Point delta)
|
||||||
{
|
{
|
||||||
ViewPort *vp = IsPtInWindowViewport(this, _cursor.pos.x, _cursor.pos.y);
|
const ViewPort *vp = IsPtInWindowViewport(this, _cursor.pos.x, _cursor.pos.y);
|
||||||
|
if (vp == NULL) return;
|
||||||
if (vp == NULL) {
|
|
||||||
_cursor.fix_at = false;
|
|
||||||
_scrolling_viewport = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this->viewport->scrollpos_x += ScaleByZoom(delta.x, vp->zoom);
|
this->viewport->scrollpos_x += ScaleByZoom(delta.x, vp->zoom);
|
||||||
this->viewport->scrollpos_y += ScaleByZoom(delta.y, vp->zoom);
|
this->viewport->scrollpos_y += ScaleByZoom(delta.y, vp->zoom);
|
||||||
|
|
Loading…
Reference in New Issue