mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-18 06:06:35 +00:00
InputText: Align caret/cursor to pixel coordinates. (#4080)
This commit is contained in:
parent
7cdb3850e7
commit
2dec7b3301
@ -56,6 +56,7 @@ Other Changes:
|
||||
- DragScalar: Add default value for v_speed argument to match higher-level functions. (#3922) [@eliasdaler]
|
||||
- ColorEdit4: Alpha default to 255 (instead of 0) when omitted in hex input. (#3973) [@squadack]
|
||||
- InputText: Do not filter private unicode codepoints (e.g. icons) when pasted from clipboard. (#4005) [@dougbinks]
|
||||
- InputText: Align caret/cursor to pixel coordinates. (#4080) [@elvissteinjr]
|
||||
- LabelText: Fixed clipping of multi-line value text when label is single-line. (#4004)
|
||||
- LabelText: Fixed vertical alignment of single-line value text when label is multi-line. (#4004)
|
||||
- Popups: Added 'OpenPopup(ImGuiID id)' overload to facilitate calling from nested stacks. (#3993, #331) [@zlash]
|
||||
|
@ -4606,7 +4606,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
{
|
||||
state->CursorAnim += io.DeltaTime;
|
||||
bool cursor_is_visible = (!g.IO.ConfigInputTextCursorBlink) || (state->CursorAnim <= 0.0f) || ImFmod(state->CursorAnim, 1.20f) <= 0.80f;
|
||||
ImVec2 cursor_screen_pos = draw_pos + cursor_offset - draw_scroll;
|
||||
ImVec2 cursor_screen_pos = ImFloor(draw_pos + cursor_offset - draw_scroll);
|
||||
ImRect cursor_screen_rect(cursor_screen_pos.x, cursor_screen_pos.y - g.FontSize + 0.5f, cursor_screen_pos.x + 1.0f, cursor_screen_pos.y - 1.5f);
|
||||
if (cursor_is_visible && cursor_screen_rect.Overlaps(clip_rect))
|
||||
draw_window->DrawList->AddLine(cursor_screen_rect.Min, cursor_screen_rect.GetBL(), GetColorU32(ImGuiCol_Text));
|
||||
|
Loading…
Reference in New Issue
Block a user