code: public boolean shouldEndDrag(int button)
  	{
  		if (!isDraggingItemStack())
  			return false;
  
  		if (dragType == DRAG_TYPE_ONE || dragType == DRAG_TYPE_SPREAD)
  			return dragType == button && draggedSlots.size() > 1;
  
  		return dragType == DRAG_TYPE_PICKUP;
  	}
docs: Checks if the dragging should end based on the mouse button clicked.
  
  @param button the button
  @return true, if dragging should end