mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-24 00:26:36 +00:00
Removed trailing spaces.
This commit is contained in:
parent
22d7f26e06
commit
d581939387
@ -157,7 +157,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
||||
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
|
||||
#endif
|
||||
|
||||
// Store GLSL version string so we can refer to it later in case we recreate shaders.
|
||||
// Store GLSL version string so we can refer to it later in case we recreate shaders.
|
||||
// Note: GLSL version is NOT the same as GL version. Leave this to NULL if unsure.
|
||||
#if defined(IMGUI_IMPL_OPENGL_ES2)
|
||||
if (glsl_version == NULL)
|
||||
|
16
imgui.cpp
16
imgui.cpp
@ -495,7 +495,7 @@ CODE
|
||||
- 2016/07/30 (1.50) - SameLine(x) with x>0.0f is now relative to left of column/group if any, and not always to left of window. This was sort of always the intent and hopefully breakage should be minimal.
|
||||
- 2016/05/12 (1.49) - title bar (using ImGuiCol_TitleBg/ImGuiCol_TitleBgActive colors) isn't rendered over a window background (ImGuiCol_WindowBg color) anymore.
|
||||
If your TitleBg/TitleBgActive alpha was 1.0f or you are using the default theme it will not affect you, otherwise if <1.0f you need tweak your custom theme to readjust for the fact that we don't draw a WindowBg background behind the title bar.
|
||||
This helper function will convert an old TitleBg/TitleBgActive color into a new one with the same visual output, given the OLD color and the OLD WindowBg color:
|
||||
This helper function will convert an old TitleBg/TitleBgActive color into a new one with the same visual output, given the OLD color and the OLD WindowBg color:
|
||||
ImVec4 ConvertTitleBgCol(const ImVec4& win_bg_col, const ImVec4& title_bg_col) { float new_a = 1.0f - ((1.0f - win_bg_col.w) * (1.0f - title_bg_col.w)), k = title_bg_col.w / new_a; return ImVec4((win_bg_col.x * win_bg_col.w + title_bg_col.x) * k, (win_bg_col.y * win_bg_col.w + title_bg_col.y) * k, (win_bg_col.z * win_bg_col.w + title_bg_col.z) * k, new_a); }
|
||||
If this is confusing, pick the RGB value from title bar from an old screenshot and apply this as TitleBg/TitleBgActive. Or you may just create TitleBgActive from a tweaked TitleBg color.
|
||||
- 2016/05/07 (1.49) - removed confusing set of GetInternalState(), GetInternalStateSize(), SetInternalState() functions. Now using CreateContext(), DestroyContext(), GetCurrentContext(), SetCurrentContext().
|
||||
@ -775,8 +775,8 @@ CODE
|
||||
==============
|
||||
|
||||
Q: How can I help?
|
||||
A: - Businesses: please reach out to "contact AT dearimgui.org" if you work in a place using Dear ImGui!
|
||||
We can discuss ways for your company to fund development via invoiced technical support, maintenance or sponsoring contacts.
|
||||
A: - Businesses: please reach out to "contact AT dearimgui.org" if you work in a place using Dear ImGui!
|
||||
We can discuss ways for your company to fund development via invoiced technical support, maintenance or sponsoring contacts.
|
||||
This is among the most useful thing you can do for Dear ImGui. With increased funding we can hire more people working on this project.
|
||||
- Individuals: you can support continued development via PayPal donations. See README.
|
||||
- If you are experienced with Dear ImGui and C++, look at the github issues, look at the Wiki, read docs/TODO.txt
|
||||
@ -1354,8 +1354,8 @@ const char* ImStrSkipBlank(const char* str)
|
||||
#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
||||
|
||||
// We support stb_sprintf which is much faster (see: https://github.com/nothings/stb/blob/master/stb_sprintf.h)
|
||||
// You may set IMGUI_USE_STB_SPRINTF to use our default wrapper, or set IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
||||
// and setup the wrapper yourself. (FIXME-OPT: Some of our high-level operations such as ImGuiTextBuffer::appendfv() are
|
||||
// You may set IMGUI_USE_STB_SPRINTF to use our default wrapper, or set IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
||||
// and setup the wrapper yourself. (FIXME-OPT: Some of our high-level operations such as ImGuiTextBuffer::appendfv() are
|
||||
// designed using two-passes worst case, which probably could be improved using the stbsp_vsprintfcb() function.)
|
||||
//#define IMGUI_USE_STB_SPRINTF
|
||||
#ifdef IMGUI_USE_STB_SPRINTF
|
||||
@ -1480,7 +1480,7 @@ ImU32 ImHashStr(const char* data_p, size_t data_size, ImU32 seed)
|
||||
ImFileHandle ImFileOpen(const char* filename, const char* mode)
|
||||
{
|
||||
#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(__CYGWIN__) && !defined(__GNUC__)
|
||||
// We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames.
|
||||
// We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames.
|
||||
const int filename_wsize = ImTextCountCharsFromUtf8(filename, NULL) + 1;
|
||||
const int mode_wsize = ImTextCountCharsFromUtf8(mode, NULL) + 1;
|
||||
ImVector<ImWchar> buf;
|
||||
@ -3875,7 +3875,7 @@ void ImGui::Initialize(ImGuiContext* context)
|
||||
ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll;
|
||||
g.SettingsHandlers.push_back(ini_handler);
|
||||
}
|
||||
|
||||
|
||||
#ifdef IMGUI_HAS_TABLE
|
||||
// Add .ini handle for ImGuiTable type
|
||||
{
|
||||
@ -10119,7 +10119,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
||||
ImGui::TreePop();
|
||||
}
|
||||
#endif // #define IMGUI_HAS_DOCK
|
||||
|
||||
|
||||
// Misc Details
|
||||
if (ImGui::TreeNode("Internal state"))
|
||||
{
|
||||
|
4
imgui.h
4
imgui.h
@ -677,7 +677,7 @@ namespace ImGui
|
||||
// - For 'int user_key_index' you can use your own indices/enums according to how your backend/engine stored them in io.KeysDown[].
|
||||
// - We don't know the meaning of those value. You can use GetKeyIndex() to map a ImGuiKey_ value into the user index.
|
||||
IMGUI_API int GetKeyIndex(ImGuiKey imgui_key); // map ImGuiKey_* values into user's key index. == io.KeyMap[key]
|
||||
IMGUI_API bool IsKeyDown(int user_key_index); // is key being held. == io.KeysDown[user_key_index].
|
||||
IMGUI_API bool IsKeyDown(int user_key_index); // is key being held. == io.KeysDown[user_key_index].
|
||||
IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat = true); // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate
|
||||
IMGUI_API bool IsKeyReleased(int user_key_index); // was key released (went from Down to !Down)?
|
||||
IMGUI_API int GetKeyPressedAmount(int key_index, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
|
||||
@ -1178,7 +1178,7 @@ enum ImGuiColorEditFlags_
|
||||
#endif
|
||||
};
|
||||
|
||||
// Identify a mouse button.
|
||||
// Identify a mouse button.
|
||||
// Those values are guaranteed to be stable and we frequently use 0/1 directly. Named enums provided for convenience.
|
||||
enum ImGuiMouseButton_
|
||||
{
|
||||
|
@ -514,7 +514,7 @@ static void ShowDemoWindowWidgets()
|
||||
}
|
||||
|
||||
{
|
||||
// To wire InputText() with std::string or any other custom string type,
|
||||
// To wire InputText() with std::string or any other custom string type,
|
||||
// see the "Text Input > Resize Callback" section of this demo, and the misc/cpp/imgui_stdlib.h file.
|
||||
static char str0[128] = "Hello, world!";
|
||||
ImGui::InputText("input text", str0, IM_ARRAYSIZE(str0));
|
||||
@ -991,7 +991,7 @@ static void ShowDemoWindowWidgets()
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
// To wire InputText() with std::string or any other custom string type,
|
||||
// To wire InputText() with std::string or any other custom string type,
|
||||
// see the "Text Input > Resize Callback" section of this demo, and the misc/cpp/imgui_stdlib.h file.
|
||||
if (ImGui::TreeNode("Text Input"))
|
||||
{
|
||||
@ -1041,7 +1041,7 @@ static void ShowDemoWindowWidgets()
|
||||
|
||||
if (ImGui::TreeNode("Resize Callback"))
|
||||
{
|
||||
// To wire InputText() with std::string or any other custom string type,
|
||||
// To wire InputText() with std::string or any other custom string type,
|
||||
// you can use the ImGuiInputTextFlags_CallbackResize flag + create a custom ImGui::InputText() wrapper using your prefered type.
|
||||
// See misc/cpp/imgui_stdlib.h for an implementation of this using std::string.
|
||||
HelpMarker("Demonstrate using ImGuiInputTextFlags_CallbackResize to wire your resizable string type to InputText().\n\nSee misc/cpp/imgui_stdlib.h for an implementation of this for std::string.");
|
||||
|
@ -517,7 +517,7 @@ void ImDrawList::PopTextureID()
|
||||
}
|
||||
|
||||
// Reserve space for a number of vertices and indices.
|
||||
// You must finish filling your reserved data before calling PrimReserve() again, as it may reallocate or
|
||||
// You must finish filling your reserved data before calling PrimReserve() again, as it may reallocate or
|
||||
// submit the intermediate results. PrimUnreserve() can be used to release unused allocations.
|
||||
void ImDrawList::PrimReserve(int idx_count, int vtx_count)
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ extern IMGUI_API ImGuiContext* GImGui; // Current implicit context pointer
|
||||
#ifdef IMGUI_DEBUG_PARANOID
|
||||
#define IM_ASSERT_PARANOID(_EXPR) IM_ASSERT(_EXPR)
|
||||
#else
|
||||
#define IM_ASSERT_PARANOID(_EXPR)
|
||||
#define IM_ASSERT_PARANOID(_EXPR)
|
||||
#endif
|
||||
|
||||
// Error handling
|
||||
@ -506,7 +506,7 @@ enum ImGuiItemStatusFlags_
|
||||
ImGuiItemStatusFlags_HasDisplayRect = 1 << 1,
|
||||
ImGuiItemStatusFlags_Edited = 1 << 2, // Value exposed by item was edited in the current frame (should match the bool return value of most widgets)
|
||||
ImGuiItemStatusFlags_ToggledSelection = 1 << 3, // Set when Selectable(), TreeNode() reports toggling a selection. We can't report "Selected" because reporting the change allows us to handle clipping with less issues.
|
||||
ImGuiItemStatusFlags_ToggledOpen = 1 << 4, // Set when TreeNode() reports toggling their open state.
|
||||
ImGuiItemStatusFlags_ToggledOpen = 1 << 4, // Set when TreeNode() reports toggling their open state.
|
||||
ImGuiItemStatusFlags_HasDeactivated = 1 << 5, // Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag.
|
||||
ImGuiItemStatusFlags_Deactivated = 1 << 6 // Only valid if ImGuiItemStatusFlags_HasDeactivated is set.
|
||||
|
||||
|
@ -5274,7 +5274,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
||||
if (!is_leaf)
|
||||
button_flags |= ImGuiButtonFlags_PressedOnDragDropHold;
|
||||
|
||||
// We allow clicking on the arrow section with keyboard modifiers held, in order to easily
|
||||
// We allow clicking on the arrow section with keyboard modifiers held, in order to easily
|
||||
// allow browsing a tree while preserving selection with code implementing multi-selection patterns.
|
||||
// When clicking on the rest of the tree node we always disallow keyboard modifiers.
|
||||
const float hit_padding_x = style.TouchExtraPadding.x;
|
||||
@ -5282,7 +5282,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
||||
const float arrow_hit_x2 = (text_pos.x - text_offset_x) + (g.FontSize + padding.x * 2.0f) + hit_padding_x;
|
||||
if (window != g.HoveredWindow || !(g.IO.MousePos.x >= arrow_hit_x1 && g.IO.MousePos.x < arrow_hit_x2))
|
||||
button_flags |= ImGuiButtonFlags_NoKeyModifiers;
|
||||
|
||||
|
||||
bool selected = (flags & ImGuiTreeNodeFlags_Selected) != 0;
|
||||
const bool was_selected = selected;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user