[USER32] Edit: Fix caret and scroll position
authorStanislav Motylkov <x86corez@gmail.com>
Mon, 18 Mar 2019 17:12:41 +0000 (20:12 +0300)
committerHermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Sun, 24 Mar 2019 22:26:20 +0000 (23:26 +0100)
Based on patch by JIRA contributor 'I_Kill_Bugs'. CORE-15780

win32ss/user/user32/controls/edit.c

index 2f2da0f..790c8c3 100644 (file)
@@ -1135,7 +1135,11 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
                        x -= es->x_offset;
                }
                else
+#ifdef __REACTOS__ /* CORE-15780 */
+                       x = (lw > 0 ? es->x_offset : x - es->x_offset);
+#else
                        x = es->x_offset;
+#endif
 
                if (es->style & ES_RIGHT)
                        x = w - (lw - x);