summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-22 21:40:36 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-22 21:40:36 +0300
commit366f4036453ee879d50820110275bf7ed69d6f8c (patch)
tree4b917f9336bb094c07fa13b7c6bc5cfbd434de36 /src/ui/documentwidget.c
parentbaddad63d8c775d9d024ef8ee80b978dcf030af9 (diff)
Text: Half-pixel glyph variants
The cache contains two variants of each glyph: zero and half-pixel offsets. This allows positioning glyph more accurately inside a text run.
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 55ac6b80..eae7c00a 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -172,9 +172,21 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
172 if (ev->type == SDL_KEYDOWN) { 172 if (ev->type == SDL_KEYDOWN) {
173 const int mods = keyMods_Sym(ev->key.keysym.mod); 173 const int mods = keyMods_Sym(ev->key.keysym.mod);
174 const int key = ev->key.keysym.sym; 174 const int key = ev->key.keysym.sym;
175 if (mods == KMOD_PRIMARY && key == 'r') { 175 switch (key) {
176 fetch_DocumentWidget_(d); 176 case 'r':
177 return iTrue; 177 if (mods == KMOD_PRIMARY) {
178 fetch_DocumentWidget_(d);
179 return iTrue;
180 }
181 break;
182 case '0': {
183 extern int enableHalfPixelGlyphs_Text;
184 enableHalfPixelGlyphs_Text = !enableHalfPixelGlyphs_Text;
185 postRefresh_App();
186 printf("halfpixel: %d\n", enableHalfPixelGlyphs_Text);
187 fflush(stdout);
188 break;
189 }
178 } 190 }
179 } 191 }
180 else if (ev->type == SDL_MOUSEWHEEL) { 192 else if (ev->type == SDL_MOUSEWHEEL) {