mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
ImGui: properly implement shift select
The new method wraps around perfectly when the new selection positions overlap each other. This patch also fixes the shift selection drifting when lines are getting deleted.
This commit is contained in:
parent
6f158811e6
commit
264c104b09
10
r5dev/thirdparty/imgui/misc/imgui_logger.cpp
vendored
10
r5dev/thirdparty/imgui/misc/imgui_logger.cpp
vendored
@ -747,16 +747,14 @@ void CTextLogger::HandleMouseInputs(bool bHoveredScrollbar, bool bActiveScrollba
|
||||
{
|
||||
if (click) // Shift select range
|
||||
{
|
||||
Coordinates newSelection = ScreenPosToCoordinates(ImGui::GetMousePos());
|
||||
const Coordinates newCursorPos = ScreenPosToCoordinates(ImGui::GetMousePos());
|
||||
|
||||
if (newSelection > m_State.m_CursorPosition)
|
||||
SetSelectionEnd(newSelection);
|
||||
else
|
||||
SetSelectionStart(newSelection);
|
||||
// Set selection from old cursor pos to new cursor pos
|
||||
m_SelectionMode = SelectionMode::Normal;
|
||||
SetSelection(m_State.m_CursorPosition, newCursorPos, m_SelectionMode);
|
||||
|
||||
m_InteractiveStart = m_State.m_SelectionStart;
|
||||
m_InteractiveEnd = m_State.m_SelectionEnd;
|
||||
m_State.m_CursorPosition = newSelection;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user