diff options
author | truelight <truelight@openttd.org> | 2006-08-21 14:34:59 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2006-08-21 14:34:59 +0000 |
commit | 9ec2fdcbf3c6a7be52e714c4086fa8e09082b2d3 (patch) | |
tree | 9114619f0346a37ef440c8665a23d7f0e5955b44 /main_gui.c | |
parent | 323a3160f7d4ad69e2472e7f94f0b1de0e39a98f (diff) | |
download | openttd-9ec2fdcbf3c6a7be52e714c4086fa8e09082b2d3.tar.xz |
(svn r6036) -Codechange: do not handle SCROLL in a central function, but let windows handle them theirself. Added WE_SCROLL for this.
Diffstat (limited to 'main_gui.c')
-rw-r--r-- | main_gui.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/main_gui.c b/main_gui.c index 3a9564d08..2e0653de9 100644 --- a/main_gui.c +++ b/main_gui.c @@ -2317,6 +2317,18 @@ static void MainWindowWndProc(Window *w, WindowEvent *e) } e->keypress.cont = false; break; + + case WE_SCROLL: { + ViewPort *vp = IsPtInWindowViewport(w, _cursor.pos.x, _cursor.pos.y); + + if (vp == NULL) { + _cursor.fix_at = false; + _scrolling_viewport = false; + } + + WP(w, vp_d).scrollpos_x += e->scroll.delta.x << vp->zoom; + WP(w, vp_d).scrollpos_y += e->scroll.delta.y << vp->zoom; + } break; } } |