Changeset - r17074:a9ec38080852
[Not reviewed]
master
0 1 0
alberth - 13 years ago 2011-01-16 11:39:57
alberth@openttd.org
(svn r21821) -Codechange: Clean up the jump conditions.
1 file changed with 4 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/window.cpp
Show inline comments
 
@@ -1428,14 +1428,16 @@ static void HandlePlacePresize()
 
 * @return State of handling the event.
 
 */
 
static EventState HandleMouseDragDrop()
 
{
 
	Window *w;
 

	
 
	if (_special_mouse_mode != WSM_DRAGDROP) goto handle_dragdop;
 
	if (!_left_button_down || (_cursor.delta.x == 0 && _cursor.delta.y == 0)) goto handle_dragdop;
 
	if (_special_mouse_mode != WSM_DRAGDROP) return ES_NOT_HANDLED;
 

	
 
	if (_left_button_down && _cursor.delta.x == 0 && _cursor.delta.y == 0) return ES_HANDLED; // Dragging, but the mouse did not move.
 
	if (!_left_button_down) goto handle_dragdop;
 

	
 
	w = _thd.GetCallbackWnd();
 

	
 
	if (w != NULL) {
 
		/* Send an event in client coordinates. */
 
		Point pt;
 
@@ -1444,15 +1446,12 @@ static EventState HandleMouseDragDrop()
 
		w->OnMouseDrag(pt, GetWidgetFromPos(w, pt.x, pt.y));
 
	}
 

	
 
	return ES_HANDLED;
 

	
 
handle_dragdop:
 
	if (_special_mouse_mode != WSM_DRAGDROP) return ES_NOT_HANDLED;
 
	if (_left_button_down) return ES_HANDLED;
 

	
 
	w = _thd.GetCallbackWnd();
 

	
 
	if (w != NULL) {
 
		/* send an event in client coordinates. */
 
		Point pt;
 
		pt.x = _cursor.pos.x - w->left;
0 comments (0 inline, 0 general)