mirror of https://github.com/OpenTTD/OpenTTD
(svn r21838) -Change: allow LMB scrolling with the mouse outside of the extra viewport instead of canceling scrolling when going slightly over the edge
parent
22d17aa745
commit
561449992a
|
@ -137,11 +137,8 @@ public:
|
||||||
|
|
||||||
virtual void OnScroll(Point delta)
|
virtual void OnScroll(Point delta)
|
||||||
{
|
{
|
||||||
const ViewPort *vp = IsPtInWindowViewport(this, _cursor.pos.x, _cursor.pos.y);
|
this->viewport->scrollpos_x += ScaleByZoom(delta.x, this->viewport->zoom);
|
||||||
if (vp == NULL) return;
|
this->viewport->scrollpos_y += ScaleByZoom(delta.y, this->viewport->zoom);
|
||||||
|
|
||||||
this->viewport->scrollpos_x += ScaleByZoom(delta.x, vp->zoom);
|
|
||||||
this->viewport->scrollpos_y += ScaleByZoom(delta.y, vp->zoom);
|
|
||||||
this->viewport->dest_scrollpos_x = this->viewport->scrollpos_x;
|
this->viewport->dest_scrollpos_x = this->viewport->scrollpos_x;
|
||||||
this->viewport->dest_scrollpos_y = this->viewport->scrollpos_y;
|
this->viewport->dest_scrollpos_y = this->viewport->scrollpos_y;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue