summaryrefslogtreecommitdiff
path: root/src/ui/inputwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/inputwidget.c')
-rw-r--r--src/ui/inputwidget.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c
index e23e5acc..3b60fc45 100644
--- a/src/ui/inputwidget.c
+++ b/src/ui/inputwidget.c
@@ -279,7 +279,7 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) {
279 279
280static void draw_InputWidget_(const iInputWidget *d) { 280static void draw_InputWidget_(const iInputWidget *d) {
281 const uint32_t time = frameTime_Window(get_Window()); 281 const uint32_t time = frameTime_Window(get_Window());
282 const iInt2 padding = init_I2(3 * gap_UI, gap_UI / 2); 282 const iInt2 padding = init_I2(gap_UI / 2, gap_UI / 2);
283 iRect bounds = adjusted_Rect(bounds_Widget(constAs_Widget(d)), padding, neg_I2(padding)); 283 iRect bounds = adjusted_Rect(bounds_Widget(constAs_Widget(d)), padding, neg_I2(padding));
284 const iBool isFocused = isFocused_Widget(constAs_Widget(d)); 284 const iBool isFocused = isFocused_Widget(constAs_Widget(d));
285 const iBool isHover = isHover_Widget(constAs_Widget(d)) && 285 const iBool isHover = isHover_Widget(constAs_Widget(d)) &&
@@ -293,6 +293,7 @@ static void draw_InputWidget_(const iInputWidget *d) {
293 adjusted_Rect(bounds, neg_I2(one_I2()), zero_I2()), 293 adjusted_Rect(bounds, neg_I2(one_I2()), zero_I2()),
294 isFocused ? orange_ColorId : isHover ? cyan_ColorId : gray50_ColorId); 294 isFocused ? orange_ColorId : isHover ? cyan_ColorId : gray50_ColorId);
295 setClip_Paint(&p, bounds); 295 setClip_Paint(&p, bounds);
296 shrink_Rect(&bounds, init_I2(gap_UI * 2, 0));
296 const iInt2 emSize = advance_Text(d->font, "M"); 297 const iInt2 emSize = advance_Text(d->font, "M");
297 const int textWidth = advance_Text(d->font, cstr_String(&text)).x; 298 const int textWidth = advance_Text(d->font, cstr_String(&text)).x;
298 const int cursorX = advanceN_Text(d->font, cstr_String(&text), d->cursor).x; 299 const int cursorX = advanceN_Text(d->font, cstr_String(&text), d->cursor).x;