DebugTools: render also non-axis-aligned boxes with proper size.

Yay for this convoluted mess (but hey, it's generic code working for
both 2D and 3D!).