Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid cursor position after mouse click on line with tabulations #86

Closed
pinam45 opened this issue Jun 13, 2019 · 3 comments
Closed

Invalid cursor position after mouse click on line with tabulations #86

pinam45 opened this issue Jun 13, 2019 · 3 comments

Comments

@pinam45
Copy link

pinam45 commented Jun 13, 2019

Problem

When I click on a line contening tabulations, the cursor is placed at a wrong position.

For example, calling only these two functions with the default font of ImGui:

editor.SetText("        abcdefghijklmnopqrstuvwxyz\n\t\tabcdefghijklmnopqrstuvwxyz\n");
editor.Render("editor", ImGui::GetContentRegionAvail(), false);

Screenshot_20190613_172825

If I click after the text on the first line the cursor is put at the right position (the end of the line), but if I click after the end of the second line the cursor is placed at a wrong position (as in the picture).

Informations

BalazsJako added a commit that referenced this issue Jun 14, 2019
…abulations

Also removed some unnecessary SanitizeCooridates calls.
@BalazsJako
Copy link
Owner

Fixed. Please test.

@pinam45
Copy link
Author

pinam45 commented Jun 14, 2019

It doesn't compile with ImGui 1.70 and IMGUI_DISABLE_OBSOLETE_FUNCTIONS defined because you changed ImGuiCol_ChildBg for ImGuiCol_ChildWindowBg in your last commit 9f8a336.

ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, ImGui::ColorConvertU32ToFloat4(mPalette[(int)PaletteIndex::Background]));

ImGuiCol_ChildWindowBg was renamed to ImGuiCol_ChildBg in ImGui 1.53
https://github.com/ocornut/imgui/blob/2645a2516f032332b68a66e20b3d2d8adc2490d0/imgui.h#L1070

Otherwise work well, thank you for this super useful widget.

@BalazsJako
Copy link
Owner

Welcome :)
Fixed the ImGuiCol_ChildWindowBg issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants