When the shift key is pressed while dragging, we want the #box
to only move on the X-axis.
- Use hierarchical (nested) states in
dragging
. What nested states would you have? - One state is for normal behavior, another is for locked behavior. How would these states transition between each other?
- Can you do something similar for the Y-axis? Naturally, we can't lock on the X-axis and Y-axis at the same time.