Added SetCursorPosX, SetCursorPosY shortcuts
This commit is contained in:
parent
2fb63b6068
commit
dd5d251273
12
imgui.cpp
12
imgui.cpp
@ -2461,6 +2461,18 @@ void SetCursorPos(const ImVec2& pos)
|
||||
window->DC.CursorPos = window->Pos + pos;
|
||||
}
|
||||
|
||||
void SetCursorPosX(float x)
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
window->DC.CursorPos.x = window->Pos.x + x;
|
||||
}
|
||||
|
||||
void SetCursorPosY(float y)
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
window->DC.CursorPos.y = window->Pos.y + y;
|
||||
}
|
||||
|
||||
ImVec2 GetCursorScreenPos()
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
|
2
imgui.h
2
imgui.h
@ -168,6 +168,8 @@ namespace ImGui
|
||||
float GetColumnWidth(int column_index = -1);
|
||||
ImVec2 GetCursorPos(); // cursor position relative to window position
|
||||
void SetCursorPos(const ImVec2& pos); // "
|
||||
void SetCursorPosX(float x); // "
|
||||
void SetCursorPosY(float y); // "
|
||||
ImVec2 GetCursorScreenPos(); // cursor position in screen space
|
||||
void AlignFirstTextHeightToWidgets(); // call once if the first item on the line is a Text() item and you want to vertically lower it to match higher widgets.
|
||||
float GetTextLineSpacing();
|
||||
|
Loading…
Reference in New Issue
Block a user