X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2FWM%2Frenderers%2Fwidget%2Ftextinput.c;h=831565b37d1a61d65e337fe8edd3b99f8befa442;hb=608ec5aa6e1bd522777faa63323beaeaef928928;hp=9a0ae64191364450d66f07b26de05e12628eda3b;hpb=8c12dd82f2a4e01d8de5d29db6d4fdd0802c7e83;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/WM/renderers/widget/textinput.c b/Usermode/Applications/axwin3_src/WM/renderers/widget/textinput.c index 9a0ae641..831565b3 100644 --- a/Usermode/Applications/axwin3_src/WM/renderers/widget/textinput.c +++ b/Usermode/Applications/axwin3_src/WM/renderers/widget/textinput.c @@ -10,7 +10,7 @@ #include #include "./common.h" #include "./colours.h" -#include +#include #include // TODO: Include a proper keysym header @@ -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; } @@ -201,7 +213,7 @@ int Widget_TextInput_KeyFire(tElement *Element, int KeySym, int Character) } // TODO: Have a Widget_ function to do this instead - WM_Invalidate(Element->Window); + WM_Invalidate(Element->Window, 1); return 0; }