win32ss/user/user32/controls/edit.c | 18 ++++++++++++++++++ dll/win32/comctl32/edit.c | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/win32ss/user/user32/controls/edit.c b/win32ss/user/user32/controls/edit.c index 70bdd1d40d..642a5b6513 100644 --- a/win32ss/user/user32/controls/edit.c +++ b/win32ss/user/user32/controls/edit.c @@ -805,7 +805,11 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta if ((es->style & ES_CENTER) || (es->style & ES_RIGHT)) rc.left = es->format_rect.left; else +#ifdef __REACTOS__ + rc.left = (short)LOWORD(EDIT_EM_PosFromChar(es, nstart_index, FALSE)); +#else rc.left = LOWORD(EDIT_EM_PosFromChar(es, nstart_index, FALSE)); +#endif rc.right = es->format_rect.right; SetRectRgn(hrgn, rc.left, rc.top, rc.right, rc.bottom); @@ -1130,8 +1134,22 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap) ScriptStringCPtoX(line_def->ssa, (index - 1) - li, TRUE, &x); x -= es->x_offset; } +#ifdef __REACTOS__ + else + { + if (lw > 0) + { + x = es->x_offset; + } + else + { + x -= es->x_offset; + } + } +#else else x = es->x_offset; +#endif if (es->style & ES_RIGHT) x = w - (lw - x); diff --git a/dll/win32/comctl32/edit.c b/dll/win32/comctl32/edit.c index e2f47d008e..05e1b04d0d 100644 --- a/dll/win32/comctl32/edit.c +++ b/dll/win32/comctl32/edit.c @@ -720,7 +720,11 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta if ((es->style & ES_CENTER) || (es->style & ES_RIGHT)) rc.left = es->format_rect.left; else +#ifdef __REACTOS__ + rc.left = (short)LOWORD(EDIT_EM_PosFromChar(es, nstart_index, FALSE)); +#else rc.left = LOWORD(EDIT_EM_PosFromChar(es, nstart_index, FALSE)); +#endif rc.right = es->format_rect.right; SetRectRgn(hrgn, rc.left, rc.top, rc.right, rc.bottom); @@ -1045,8 +1049,22 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap) ScriptStringCPtoX(line_def->ssa, (index - 1) - li, TRUE, &x); x -= es->x_offset; } +#ifdef __REACTOS__ + else + { + if (lw > 0) + { + x = es->x_offset; + } + else + { + x -= es->x_offset; + } + } +#else else x = es->x_offset; +#endif if (es->style & ES_RIGHT) x = w - (lw - x);