Changeset - r23339:5d335bede63d
[Not reviewed]
master
0 1 0
Peter Nelson - 5 years ago 2019-02-14 06:27:16
peter1138@openttd.org
Change: Make mini-map widget capture mouse when left-click dragging.

This allows the mini-map to be dragged when the cursor has left the widget.
1 file changed with 1 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/smallmap_gui.cpp
Show inline comments
 
@@ -1401,15 +1401,7 @@ int SmallMapWindow::GetPositionOnLegend(
 
{
 
	switch (widget) {
 
		case WID_SM_MAP: { // Map window
 
			/*
 
			 * XXX: scrolling with the left mouse button is done by subsequently
 
			 * clicking with the left mouse button; clicking once centers the
 
			 * large map at the selected point. So by unclicking the left mouse
 
			 * button here, it gets reclicked during the next inputloop, which
 
			 * would make it look like the mouse is being dragged, while it is
 
			 * actually being (virtually) clicked every inputloop.
 
			 */
 
			_left_button_clicked = false;
 
			if (click_count > 0) this->mouse_capture_widget = widget;
 

	
 
			const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP);
 
			Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
0 comments (0 inline, 0 general)