(svn r15598) -Fix [FS#2695]: crash when opening viewport while scrolling the map and the mouse 'lands' on the window decoration of the viewport.

pull/155/head
rubidium 16 years ago
parent 12e5355c7c
commit 83888098db

@ -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…
Cancel
Save