Cater for single state without transitions

Changed the max transitions to handle empty lists. And prevent the width
and height being smaller than the canvas width and height
Set height from state when no transitions

In no transitions height was calculated as canvas height but should be
height of last state
Selected state and last state with 0 transitions

Two cases where the are transitions overrall but:
1. The selected state's dialog has no transitions - set Y to the state's
Y + H
2. The last state's dialog has no transitions - set H to the last
state's Y + H