git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Usermode/AxWin3 - Added proper mid-character clipping to font rendering
[tpg/acess2.git]
/
Usermode
/
Applications
/
axwin3_src
/
WM
/
renderers
/
widget
/
textinput.c
diff --git
a/Usermode/Applications/axwin3_src/WM/renderers/widget/textinput.c
b/Usermode/Applications/axwin3_src/WM/renderers/widget/textinput.c
index
9a0ae64
..
831565b
100644
(file)
--- 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 <common.h>
#include "./common.h"
#include "./colours.h"
#include <common.h>
#include "./common.h"
#include "./colours.h"
-#include <u
tf8
.h>
+#include <u
nicode
.h>
#include <string.h>
// TODO: Include a proper keysym header
#include <string.h>
// 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;
{
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);
}
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->CursorByteOfs += len;
+ info->CursorXOfs += w;
}
break;
}
}
break;
}
@@
-201,7
+213,7
@@
int Widget_TextInput_KeyFire(tElement *Element, int KeySym, int Character)
}
// TODO: Have a Widget_ function to do this instead
}
// TODO: Have a Widget_ function to do this instead
- WM_Invalidate(Element->Window);
+ WM_Invalidate(Element->Window
, 1
);
return 0;
}
return 0;
}
UCC
git Repository :: git.ucc.asn.au