Hacker News new | ask | show | jobs
by mysterydip 1300 days ago
I forget the exact algorithm, but you can factor in your x with y. For right-facing sides, anything at the same y with a greater x is in front of a lesser x, and vice versa for left-facing sides.