Skip to content

Commit ed7fd6b

Browse files
authored
Makes TextSelect aware of the Indent(20.0f) offset, so selection rectangles and mouse hit-testing now align with the indented text. (#14)
1 parent afb8a11 commit ed7fd6b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

textselect.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ void TextSelect::selectAll() {
468468
void TextSelect::update() {
469469
// ImGui::GetCursorStartPos() is in window coordinates so it is added to the window position
470470
ImVec2 cursorPosStart = ImGui::GetWindowPos() + ImGui::GetCursorStartPos();
471+
cursorPosStart.x += ImGui::GetCurrentWindow()->DC.Indent.x;
471472

472473
// Switch cursors if the window is hovered
473474
bool hovered = ImGui::IsWindowHovered();

0 commit comments

Comments
 (0)