Changeset - r17227:09618fcc767a
[Not reviewed]
master
0 4 0
frosch - 14 years ago 2011-02-05 16:36:37
frosch@openttd.org
(svn r21977) -Codechange: Always cal Window::OnMouseWheel(), independent of viewport scroll/zoom settings.
4 files changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/main_gui.cpp
Show inline comments
 
@@ -421,8 +421,10 @@ struct MainWindow : Window
 

	
 
	virtual void OnMouseWheel(int wheel)
 
	{
 
		if (_settings_client.gui.scrollwheel_scrolling == 0) {
 
		ZoomInOrOutToCursorWindow(wheel < 0, this);
 
	}
 
	}
 

	
 
	virtual void OnResize()
 
	{
src/smallmap_gui.cpp
Show inline comments
 
@@ -1461,6 +1461,7 @@ public:
 

	
 
	virtual void OnMouseWheel(int wheel)
 
	{
 
		if (_settings_client.gui.scrollwheel_scrolling == 0) {
 
		const NWidgetBase *wid = this->GetWidget<NWidgetBase>(SM_WIDGET_MAP);
 
		int cursor_x = _cursor.pos.x - this->left - wid->pos_x;
 
		int cursor_y = _cursor.pos.y - this->top  - wid->pos_y;
 
@@ -1469,6 +1470,7 @@ public:
 
			this->SetZoomLevel((wheel < 0) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &pt);
 
		}
 
	}
 
	}
 

	
 
	virtual void OnTick()
 
	{
src/viewport_gui.cpp
Show inline comments
 
@@ -143,8 +143,10 @@ public:
 

	
 
	virtual void OnMouseWheel(int wheel)
 
	{
 
		if (_settings_client.gui.scrollwheel_scrolling == 0) {
 
		ZoomInOrOutToCursorWindow(wheel < 0, this);
 
	}
 
	}
 

	
 
	virtual void OnInvalidateData(int data = 0)
 
	{
src/window.cpp
Show inline comments
 
@@ -2184,10 +2184,8 @@ static void MouseLoop(MouseClick click, 
 
	if (vp != NULL && (_game_mode == GM_MENU || IsGeneratingWorld())) return;
 

	
 
	if (mousewheel != 0) {
 
		if (_settings_client.gui.scrollwheel_scrolling == 0) {
 
			/* Send mousewheel event to window */
 
			w->OnMouseWheel(mousewheel);
 
		}
 

	
 
		/* Dispatch a MouseWheelEvent for widgets if it is not a viewport */
 
		if (vp == NULL) DispatchMouseWheelEvent(w, w->nested_root->GetWidgetFromPos(x - w->left, y - w->top), mousewheel);
0 comments (0 inline, 0 general)