Changeset - r22872:74e10e9baeb0
[Not reviewed]
master
0 4 0
Alexander Weiss - 6 years ago 2018-04-27 22:12:49
ik@alexanderweiss.nl
Change: [OSX] Setting mouse-wheel to scroll the map does not disable pinch to zoom
4 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/main_gui.cpp
Show inline comments
 
@@ -439,7 +439,7 @@ struct MainWindow : Window
 

	
 
	virtual void OnMouseWheel(int wheel)
 
	{
 
		if (_settings_client.gui.scrollwheel_scrolling == 0) {
 
		if (_settings_client.gui.scrollwheel_scrolling != 2) {
 
			ZoomInOrOutToCursorWindow(wheel < 0, this);
 
		}
 
	}
src/smallmap_gui.cpp
Show inline comments
 
@@ -1559,7 +1559,7 @@ int SmallMapWindow::GetPositionOnLegend(
 

	
 
/* virtual */ void SmallMapWindow::OnMouseWheel(int wheel)
 
{
 
	if (_settings_client.gui.scrollwheel_scrolling == 0) {
 
	if (_settings_client.gui.scrollwheel_scrolling != 2) {
 
		const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP);
 
		int cursor_x = _cursor.pos.x - this->left - wid->pos_x;
 
		int cursor_y = _cursor.pos.y - this->top  - wid->pos_y;
src/viewport_gui.cpp
Show inline comments
 
@@ -138,7 +138,7 @@ public:
 

	
 
	virtual void OnMouseWheel(int wheel)
 
	{
 
		if (_settings_client.gui.scrollwheel_scrolling == 0) {
 
		if (_settings_client.gui.scrollwheel_scrolling != 2) {
 
			ZoomInOrOutToCursorWindow(wheel < 0, this);
 
		}
 
	}
src/window.cpp
Show inline comments
 
@@ -2858,8 +2858,8 @@ static void MouseLoop(MouseClick click, 
 
	if (vp != NULL && (_game_mode == GM_MENU || HasModalProgress())) return;
 

	
 
	if (mousewheel != 0) {
 
		/* Send mousewheel event to window */
 
		w->OnMouseWheel(mousewheel);
 
		/* Send mousewheel event to window, unless we're scrolling a viewport or the map */
 
		if (!scrollwheel_scrolling || (vp == NULL && w->window_class != WC_SMALLMAP)) 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)