Proper z-order for drawing