mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 21:39:54 +02:00
InputText: Fixed various display corruption related to swapping the underlying buffer while a input widget is active (both for writable and read-only paths). Often they would manifest when manipulating the scrollbar of a multi-line input text.
This commit is contained in:
@ -572,10 +572,11 @@ struct IMGUI_API ImGuiMenuColumns
|
||||
struct IMGUI_API ImGuiInputTextState
|
||||
{
|
||||
ImGuiID ID; // widget id owning the text state
|
||||
int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format.
|
||||
int CurLenW, CurLenA; // we need to maintain our buffer length in both UTF-8 and wchar format. UTF-8 len is valid even if TextA is not.
|
||||
ImVector<ImWchar> TextW; // edit buffer, we need to persist but can't guarantee the persistence of the user-provided buffer. so we copy into own buffer.
|
||||
ImVector<char> TextA; // temporary UTF8 buffer for callbacks and other operations. this is not updated in every code-path! size=capacity.
|
||||
ImVector<char> InitialTextA; // backup of end-user buffer at the time of focus (in UTF-8, unaltered)
|
||||
bool TextAIsValid; // temporary UTF8 buffer is not initially valid before we make the widget active (until then we pull the data from user argument)
|
||||
int BufCapacityA; // end-user buffer capacity
|
||||
float ScrollX; // horizontal scrolling/offset
|
||||
ImStb::STB_TexteditState Stb; // state for stb_textedit.h
|
||||
|
Reference in New Issue
Block a user