Simplify and fix midpoint drawing logic (fixes #2136)