These two code paths for vertical and horizontal orientations used two different functions to clamp values. This commit makes them consistent. Amends a3943400.