Better depth sort based on object baseline.

The new behavior takes the height of the object into considering,
resolving some issues where smaller objects were incorrectly clipping
through other larger objects.