From: John Hodge Date: Sun, 1 Apr 2012 02:34:10 +0000 (+0800) Subject: Usermode/AxWin3 WM - Fixed cursor position not changing in edit control when arrow... X-Git-Tag: rel0.15~711^2~3 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=07b3bc914c1345a41cebcf019ea93f406c3168fc;p=tpg%2Facess2.git Usermode/AxWin3 WM - Fixed cursor position not changing in edit control when arrow keys used --- diff --git a/Usermode/Applications/axwin3_src/WM/renderers/widget/textinput.c b/Usermode/Applications/axwin3_src/WM/renderers/widget/textinput.c index 9a0ae641..6d34a8e3 100644 --- a/Usermode/Applications/axwin3_src/WM/renderers/widget/textinput.c +++ b/Usermode/Applications/axwin3_src/WM/renderers/widget/textinput.c @@ -140,13 +140,25 @@ int Widget_TextInput_KeyFire(tElement *Element, int KeySym, int Character) { len = ReadUTF8Rev(Element->Text, info->CursorByteOfs, &cp); info->CursorByteOfs -= len; + WM_Render_GetTextDims( + gpTextInput_Font, + Element->Text+info->CursorByteOfs, + len, &w, 0 + ); + info->CursorXOfs -= w; } break; case KEYSYM_RIGHTARROW: if( info->CursorByteOfs < info->Length ) { len = ReadUTF8(Element->Text + info->CursorByteOfs, &cp); + WM_Render_GetTextDims( + gpTextInput_Font, + Element->Text+info->CursorByteOfs, + len, &w, 0 + ); info->CursorByteOfs += len; + info->CursorXOfs += w; } break; }