editor: more intuitive cursor positioning
editor: more intuitive cursor positioning

Compute the nearest glyph edge instead of taking the one to the
left of the cursor.

Also fixes a segfault when trying to compute the position for an empty
buffer.

Gnurou/weston,eyolfson/weston,jonnylamb/weston,eyolfson/weston,mchalupa/weston,krezovic/weston,Fantu/compositor-spice,xorgy/weston,xorgy/weston,Fantu/compositor-spice,Gnurou/weston,sir-murray/weston,Fantu/compositor-spice,sir-murray/weston,jonnylamb/weston,giucam/weston,giucam/weston,Tarnyko/weston-xdg_surface_present,krezovic/weston,Tarnyko/weston-xdg_surface_present,kwm81/weston,mchalupa/weston,udoprog/weston,udoprog/weston,kwm81/weston