ImGui: fix regression in logger after improving cursor selections

If you triple click a line in the logger, the selection mode will be set to SelectionMode::Line, however, when we drag with the mouse, the selection remain on SelectionMode::Line, causing the cursor to be stuck, which breaks the ability to scroll select. Mode must be set to normal during dragging.
This commit is contained in:
Kawe Mazidjatari 2024-02-29 02:01:41 +01:00
parent 71f151397a
commit 405a16d982

View File

@ -736,7 +736,9 @@ void CTextLogger::HandleMouseInputs(bool bHoveredScrollbar, bool bActiveScrollba
// Mouse left button dragging (=> update selection)
else if (ImGui::IsMouseDragging(0) && ImGui::IsMouseDown(0))
{
m_SelectionMode = SelectionMode::Normal;
io.WantCaptureMouse = true;
m_State.m_CursorPosition = m_InteractiveEnd = ScreenPosToCoordinates(ImGui::GetMousePos());
SetSelection(m_InteractiveStart, m_InteractiveEnd, m_SelectionMode);