(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:
rubidium 2009-03-02 18:01:33 +00:00
parent f5a07faf87
commit b1c105e77e
1 changed files with 2 additions and 6 deletions

View File

@ -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);