If you can, post a current code with traditional drag in all directions, which shows how to apply this logic when you have a little time.
For now, it follows the logic in code "agnostic":
By clicking on the mouse:
xOrigemObjeto = xAtualObjeto;
yOrigemObjeto = yAtualObjeto;
xOrigemMouse = xMouse;
yOrigemMouse = yMouse;
During drag (in the mouse movement Signal):
deltaX = xOrigemMouse - xMouse;
deltaY = yOrigemMouse - yMouse;
if( abs( deltaX ) > abs( deltaY ) ) {
xAtualObjeto = xOrigemObjeto + deltaX;
yAtualObjeto = yOrigemObjeto;
} else {
xAtualObjeto = xOrigemObjeto;
yAtualObjeto = yOrigemObjeto + deltaY;
}
Only care is to update the object source only after the user drops the mouse.
Basically what we are doing here is to consider whether the mouse walked more on X or Y, and change only one of the positions, "locking" the other.
How exactly are you making the move? Show relevant part of your code.
– Guilherme Bernal