The former code gave a priority to portrait orientation, i.e. if the portrait threshold reached, it always switched.
This is incorrect due to that landscape thresholds and portrait thresholds can (and they do) overlap.
In the overlapping area we should respect previous value.
The former code gave a priority to portrait orientation, i.e. if the portrait threshold reached, it always switched.
This is incorrect due to that landscape thresholds and portrait thresholds can (and they do) overlap. In the overlapping area we should respect previous value.