int ME_CharFromPoint(ME_TextEditor *editor, int cx, ME_Run *run, BOOL closest, BOOL visual_order) { ME_Context c; int ret; ME_InitContext( &c, editor, ITextHost_TxGetDC( editor->texthost ) ); ret = ME_CharFromPointContext( &c, cx, run, closest, visual_order ); ME_DestroyContext(&c); return ret; }
/****************************************************************************** * find_split_point * * Returns a character position to split inside the run given a run-relative * pixel horizontal position. This version rounds left (ie. if the second * character is at pixel position 8, then for cx=0..7 it returns 0). */ static int find_split_point( ME_Context *c, int cx, ME_Run *run ) { if (!run->len || cx <= 0) return 0; return ME_CharFromPointContext( c, cx, run, FALSE, FALSE ); }