mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-12 02:00:58 +01:00
Remove trailing spaces (grep for ' \r?$' in visual studio)
This commit is contained in:
parent
404dc0367e
commit
7d5a17e5e4
@ -17,7 +17,7 @@
|
||||
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
|
||||
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
|
||||
|
||||
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
|
||||
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
|
||||
// Using dear imgui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
|
||||
//#define IMGUI_API __declspec( dllexport )
|
||||
//#define IMGUI_API __declspec( dllimport )
|
||||
@ -64,9 +64,9 @@
|
||||
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
||||
*/
|
||||
|
||||
//---- Using 32-bits vertex indices (default is 16-bits) is one way to allow large meshes with more than 64K vertices.
|
||||
//---- Using 32-bits vertex indices (default is 16-bits) is one way to allow large meshes with more than 64K vertices.
|
||||
// Your renderer back-end will need to support it (most example renderer back-ends support both 16/32-bits indices).
|
||||
// Another way to allow large meshes while keeping 16-bits indices is to handle ImDrawCmd::VtxOffset in your renderer.
|
||||
// Another way to allow large meshes while keeping 16-bits indices is to handle ImDrawCmd::VtxOffset in your renderer.
|
||||
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
|
||||
//#define ImDrawIdx unsigned int
|
||||
|
||||
|
42
imgui.cpp
42
imgui.cpp
@ -575,17 +575,17 @@ CODE
|
||||
Q: Where is the documentation?
|
||||
A: This library is poorly documented at the moment and expects of the user to be acquainted with C/C++.
|
||||
- Run the examples/ and explore them.
|
||||
- See demo code in imgui_demo.cpp and particularly the ImGui::ShowDemoWindow() function.
|
||||
- The demo covers most features of Dear ImGui, so you can read the code and see its output.
|
||||
- See demo code in imgui_demo.cpp and particularly the ImGui::ShowDemoWindow() function.
|
||||
- The demo covers most features of Dear ImGui, so you can read the code and see its output.
|
||||
- See documentation and comments at the top of imgui.cpp + effectively imgui.h.
|
||||
- Dozens of standalone example applications using e.g. OpenGL/DirectX are provided in the examples/
|
||||
- Dozens of standalone example applications using e.g. OpenGL/DirectX are provided in the examples/
|
||||
folder to explain how to integrate Dear ImGui with your own engine/application.
|
||||
- Your programming IDE is your friend, find the type or function declaration to find comments
|
||||
- Your programming IDE is your friend, find the type or function declaration to find comments
|
||||
associated to it.
|
||||
|
||||
Q: Which version should I get?
|
||||
A: I occasionally tag Releases (https://github.com/ocornut/imgui/releases) but it is generally safe
|
||||
and recommended to sync to master/latest. The library is fairly stable and regressions tend to be
|
||||
A: I occasionally tag Releases (https://github.com/ocornut/imgui/releases) but it is generally safe
|
||||
and recommended to sync to master/latest. The library is fairly stable and regressions tend to be
|
||||
fixed fast when reported. You may also peak at the 'docking' branch which includes:
|
||||
- Docking/Merging features (https://github.com/ocornut/imgui/issues/2109)
|
||||
- Multi-viewport features (https://github.com/ocornut/imgui/issues/1542)
|
||||
@ -597,11 +597,11 @@ CODE
|
||||
for a list of games/software which are publicly known to use dear imgui. Please add yours if you can!
|
||||
|
||||
Q: Why the odd dual naming, "Dear ImGui" vs "ImGui"?
|
||||
A: The library started its life as "ImGui" due to the fact that I didn't give it a proper name when
|
||||
when I released 1.0, and had no particular expectation that it would take off. However, the term IMGUI
|
||||
(immediate-mode graphical user interface) was coined before and is being used in variety of other
|
||||
situations (e.g. Unity uses it own implementation of the IMGUI paradigm).
|
||||
To reduce the ambiguity without affecting existing code bases, I have decided on an alternate,
|
||||
A: The library started its life as "ImGui" due to the fact that I didn't give it a proper name when
|
||||
when I released 1.0, and had no particular expectation that it would take off. However, the term IMGUI
|
||||
(immediate-mode graphical user interface) was coined before and is being used in variety of other
|
||||
situations (e.g. Unity uses it own implementation of the IMGUI paradigm).
|
||||
To reduce the ambiguity without affecting existing code bases, I have decided on an alternate,
|
||||
longer name "Dear ImGui" that people can use to refer to this specific library.
|
||||
Please try to refer to this library as "Dear ImGui".
|
||||
|
||||
@ -2488,7 +2488,7 @@ void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, cons
|
||||
|
||||
// Another overly complex function until we reorganize everything into a nice all-in-one helper.
|
||||
// This is made more complex because we have dissociated the layout rectangle (pos_min..pos_max) which define _where_ the ellipsis is, from actual clipping of text and limit of the ellipsis display.
|
||||
// This is because in the context of tabs we selectively hide part of the text when the Close Button appears, but we don't want the ellipsis to move.
|
||||
// This is because in the context of tabs we selectively hide part of the text when the Close Button appears, but we don't want the ellipsis to move.
|
||||
void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, float clip_max_x, float ellipsis_max_x, const char* text, const char* text_end_full, const ImVec2* text_size_if_known)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
@ -2996,8 +2996,8 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg)
|
||||
{
|
||||
// Navigation processing runs prior to clipping early-out
|
||||
// (a) So that NavInitRequest can be honored, for newly opened windows to select a default widget
|
||||
// (b) So that we can scroll up/down past clipped items. This adds a small O(N) cost to regular navigation requests
|
||||
// unfortunately, but it is still limited to one window. It may not scale very well for windows with ten of
|
||||
// (b) So that we can scroll up/down past clipped items. This adds a small O(N) cost to regular navigation requests
|
||||
// unfortunately, but it is still limited to one window. It may not scale very well for windows with ten of
|
||||
// thousands of item, but at least NavMoveRequest is only set on user interaction, aka maximum once a frame.
|
||||
// We could early out with "if (is_clipped && !g.NavInitRequest) return false;" but when we wouldn't be able
|
||||
// to reach unclipped widgets. This would work if user had explicit scrolling control (e.g. mapped on a stick).
|
||||
@ -4044,7 +4044,7 @@ static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* d
|
||||
return;
|
||||
}
|
||||
|
||||
// Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
|
||||
// Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
|
||||
// May trigger for you if you are using PrimXXX functions incorrectly.
|
||||
IM_ASSERT(draw_list->VtxBuffer.Size == 0 || draw_list->_VtxWritePtr == draw_list->VtxBuffer.Data + draw_list->VtxBuffer.Size);
|
||||
IM_ASSERT(draw_list->IdxBuffer.Size == 0 || draw_list->_IdxWritePtr == draw_list->IdxBuffer.Data + draw_list->IdxBuffer.Size);
|
||||
@ -4053,7 +4053,7 @@ static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* d
|
||||
|
||||
// Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = unsigned short = 2 bytes = 64K vertices per ImDrawList = per window)
|
||||
// If this assert triggers because you are drawing lots of stuff manually:
|
||||
// - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds.
|
||||
// - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds.
|
||||
// Be mindful that the ImDrawList API doesn't filter vertices. Use the Metrics window to inspect draw list contents.
|
||||
// - If you want large meshes with more than 64K vertices, you can either:
|
||||
// (A) Handle the ImDrawCmd::VtxOffset value in your renderer back-end, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'.
|
||||
@ -4062,9 +4062,9 @@ static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* d
|
||||
// (B) Or handle 32-bits indices in your renderer back-end, and uncomment '#define ImDrawIdx unsigned int' line in imconfig.h.
|
||||
// Most example back-ends already support this. For example, the OpenGL example code detect index size at compile-time:
|
||||
// glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset);
|
||||
// Your own engine or render API may use different parameters or function calls to specify index sizes.
|
||||
// Your own engine or render API may use different parameters or function calls to specify index sizes.
|
||||
// 2 and 4 bytes indices are generally supported by most graphics API.
|
||||
// - If for some reason neither of those solutions works for you, a workaround is to call BeginChild()/EndChild() before reaching
|
||||
// - If for some reason neither of those solutions works for you, a workaround is to call BeginChild()/EndChild() before reaching
|
||||
// the 64K limit to split your draw commands in multiple draw lists.
|
||||
if (sizeof(ImDrawIdx) == 2)
|
||||
IM_ASSERT(draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above");
|
||||
@ -4381,7 +4381,7 @@ int ImGui::GetKeyIndex(ImGuiKey imgui_key)
|
||||
// Note that imgui doesn't know the semantic of each entry of io.KeysDown[]. Use your own indices/enums according to how your back-end/engine stored them into io.KeysDown[]!
|
||||
bool ImGui::IsKeyDown(int user_key_index)
|
||||
{
|
||||
if (user_key_index < 0)
|
||||
if (user_key_index < 0)
|
||||
return false;
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown));
|
||||
@ -5741,7 +5741,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
window->OuterRectClipped.ClipWith(host_rect);
|
||||
|
||||
// Inner rectangle
|
||||
// Not affected by window border size. Used by:
|
||||
// Not affected by window border size. Used by:
|
||||
// - InnerClipRect
|
||||
// - ScrollToBringRectIntoView()
|
||||
// - NavUpdatePageUpPageDown()
|
||||
@ -5819,7 +5819,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
render_decorations_in_parent = true;
|
||||
if (render_decorations_in_parent)
|
||||
window->DrawList = parent_window->DrawList;
|
||||
|
||||
|
||||
// Handle title bar, scrollbar, resize grips and resize borders
|
||||
const ImGuiWindow* window_to_highlight = g.NavWindowingTarget ? g.NavWindowingTarget : g.NavWindow;
|
||||
const bool title_bar_is_highlight = want_focus || (window_to_highlight && window->RootWindowForTitleBarHighlight == window_to_highlight->RootWindowForTitleBarHighlight);
|
||||
|
14
imgui.h
14
imgui.h
@ -328,7 +328,7 @@ namespace ImGui
|
||||
IMGUI_API ImU32 GetColorU32(ImU32 col); // retrieve given color with style alpha applied
|
||||
|
||||
// Parameters stacks (current window)
|
||||
IMGUI_API void PushItemWidth(float item_width); // set width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side). 0.0f = default to ~2/3 of windows width,
|
||||
IMGUI_API void PushItemWidth(float item_width); // set width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side). 0.0f = default to ~2/3 of windows width,
|
||||
IMGUI_API void PopItemWidth();
|
||||
IMGUI_API void SetNextItemWidth(float item_width); // set width of the _next_ common large "item+label" widget. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side)
|
||||
IMGUI_API float CalcItemWidth(); // width of item given pushed settings and current cursor position. NOT necessarily the width of last item unlike most 'Item' functions.
|
||||
@ -1764,7 +1764,7 @@ struct ImColor
|
||||
|
||||
// Draw callbacks for advanced uses.
|
||||
// NB: You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering,
|
||||
// you can poke into the draw list for that! Draw callback may be useful for example to:
|
||||
// you can poke into the draw list for that! Draw callback may be useful for example to:
|
||||
// A) Change your GPU render state,
|
||||
// B) render a complex 3D scene inside a UI element without an intermediate texture/render target, etc.
|
||||
// The expected behavior from your rendering function is 'if (cmd.UserCallback != NULL) { cmd.UserCallback(parent_list, cmd); } else { RenderTriangles() }'
|
||||
@ -1795,7 +1795,7 @@ struct ImDrawCmd
|
||||
ImDrawCmd() { ElemCount = 0; TextureId = (ImTextureID)NULL; VtxOffset = IdxOffset = 0; UserCallback = NULL; UserCallbackData = NULL; }
|
||||
};
|
||||
|
||||
// Vertex index
|
||||
// Vertex index
|
||||
// (to allow large meshes with 16-bits indices: set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset' and handle ImDrawCmd::VtxOffset in the renderer back-end)
|
||||
// (to use 32-bits indices: override with '#define ImDrawIdx unsigned int' in imconfig.h)
|
||||
#ifndef ImDrawIdx
|
||||
@ -1826,7 +1826,7 @@ struct ImDrawChannel
|
||||
};
|
||||
|
||||
// Split/Merge functions are used to split the draw list into different layers which can be drawn into out of order.
|
||||
// This is used by the Columns api, so items of each column can be batched together in a same draw call.
|
||||
// This is used by the Columns api, so items of each column can be batched together in a same draw call.
|
||||
struct ImDrawListSplitter
|
||||
{
|
||||
int _Current; // Current channel number (0)
|
||||
@ -1867,7 +1867,7 @@ enum ImDrawListFlags_
|
||||
// Draw command list
|
||||
// This is the low-level list of polygons that ImGui:: functions are filling. At the end of the frame,
|
||||
// all command lists are passed to your ImGuiIO::RenderDrawListFn function for rendering.
|
||||
// Each dear imgui window contains its own ImDrawList. You can use ImGui::GetWindowDrawList() to
|
||||
// Each dear imgui window contains its own ImDrawList. You can use ImGui::GetWindowDrawList() to
|
||||
// access the current window draw list and draw custom primitives.
|
||||
// You can interleave normal ImGui:: calls and adding primitives to the current draw list.
|
||||
// All positions are generally in pixel coordinates (top-left at (0,0), bottom-right at io.DisplaySize), but you are totally free to apply whatever transformation matrix to want to the data (if you apply such transformation you'll want to apply it to ClipRect as well)
|
||||
@ -2126,9 +2126,9 @@ struct ImFontAtlas
|
||||
// [BETA] Custom Rectangles/Glyphs API
|
||||
//-------------------------------------------
|
||||
|
||||
// You can request arbitrary rectangles to be packed into the atlas, for your own purposes.
|
||||
// You can request arbitrary rectangles to be packed into the atlas, for your own purposes.
|
||||
// After calling Build(), you can query the rectangle position and render your pixels.
|
||||
// You can also request your rectangles to be mapped as font glyph (given a font + Unicode point),
|
||||
// You can also request your rectangles to be mapped as font glyph (given a font + Unicode point),
|
||||
// so you can render e.g. custom colorful icons and use them as regular glyphs.
|
||||
// Read misc/fonts/README.txt for more details about using colorful icons.
|
||||
IMGUI_API int AddCustomRectRegular(unsigned int id, int width, int height); // Id needs to be >= 0x10000. Id >= 0x80000000 are reserved for ImGui and ImDrawList
|
||||
|
@ -17,7 +17,7 @@
|
||||
// In this demo code, we frequently we use 'static' variables inside functions. A static variable persist across calls, so it is
|
||||
// essentially like a global variable but declared inside the scope of the function. We do this as a way to gather code and data
|
||||
// in the same place, to make the demo source code faster to read, faster to write, and smaller in size.
|
||||
// It also happens to be a convenient way of storing simple UI related information as long as your function doesn't need to be
|
||||
// It also happens to be a convenient way of storing simple UI related information as long as your function doesn't need to be
|
||||
// reentrant or used in multiple threads. This might be a pattern you will want to use in your code, but most of the real data
|
||||
// you would be editing is likely going to be stored outside your functions.
|
||||
|
||||
@ -589,7 +589,7 @@ static void ShowDemoWindowWidgets()
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
// Use SetNextItemOpen() so set the default state of a node to be open.
|
||||
// Use SetNextItemOpen() so set the default state of a node to be open.
|
||||
// We could also use TreeNodeEx() with the ImGuiTreeNodeFlags_DefaultOpen flag to achieve the same thing!
|
||||
if (i == 0)
|
||||
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||
@ -1109,7 +1109,7 @@ static void ShowDemoWindowWidgets()
|
||||
if (progress <= -0.1f) { progress = -0.1f; progress_dir *= -1.0f; }
|
||||
}
|
||||
|
||||
// Typically we would use ImVec2(-1.0f,0.0f) or ImVec2(-FLT_MIN,0.0f) to use all available width,
|
||||
// Typically we would use ImVec2(-1.0f,0.0f) or ImVec2(-FLT_MIN,0.0f) to use all available width,
|
||||
// or ImVec2(width,0.0f) for a specified width. ImVec2(0.0f,0.0f) uses ItemWidth.
|
||||
ImGui::ProgressBar(progress, ImVec2(0.0f,0.0f));
|
||||
ImGui::SameLine(0.0f, ImGui::GetStyle().ItemInnerSpacing.x);
|
||||
@ -2259,7 +2259,7 @@ static void ShowDemoWindowLayout()
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(100);
|
||||
ImGui::DragFloat("##csx", &contents_size_x);
|
||||
ImVec2 p = ImGui::GetCursorScreenPos();
|
||||
ImVec2 p = ImGui::GetCursorScreenPos();
|
||||
ImGui::GetWindowDrawList()->AddRectFilled(p, ImVec2(p.x + 10, p.y + 10), IM_COL32_WHITE);
|
||||
ImGui::GetWindowDrawList()->AddRectFilled(ImVec2(p.x + contents_size_x - 10, p.y), ImVec2(p.x + contents_size_x, p.y + 10), IM_COL32_WHITE);
|
||||
ImGui::Dummy(ImVec2(0, 10));
|
||||
|
@ -1202,7 +1202,7 @@ void ImDrawListSplitter::ClearFreeMemory()
|
||||
{
|
||||
for (int i = 0; i < _Channels.Size; i++)
|
||||
{
|
||||
if (i == _Current)
|
||||
if (i == _Current)
|
||||
memset(&_Channels[i], 0, sizeof(_Channels[i])); // Current channel is a copy of CmdBuffer/IdxBuffer, don't destruct again
|
||||
_Channels[i]._CmdBuffer.clear();
|
||||
_Channels[i]._IdxBuffer.clear();
|
||||
@ -1307,7 +1307,7 @@ void ImDrawListSplitter::Merge(ImDrawList* draw_list)
|
||||
void ImDrawListSplitter::SetCurrentChannel(ImDrawList* draw_list, int idx)
|
||||
{
|
||||
IM_ASSERT(idx >= 0 && idx < _Count);
|
||||
if (_Current == idx)
|
||||
if (_Current == idx)
|
||||
return;
|
||||
// Overwrite ImVector (12/16 bytes), four times. This is merely a silly optimization instead of doing .swap()
|
||||
memcpy(&_Channels.Data[_Current]._CmdBuffer, &draw_list->CmdBuffer, sizeof(draw_list->CmdBuffer));
|
||||
|
@ -809,7 +809,7 @@ struct ImGuiNextWindowData
|
||||
void* SizeCallbackUserData;
|
||||
float BgAlphaVal;
|
||||
ImVec2 MenuBarOffsetMinVal; // *Always on* This is not exposed publicly, so we don't clear it.
|
||||
|
||||
|
||||
ImGuiNextWindowData() { memset(this, 0, sizeof(*this)); }
|
||||
inline void ClearFlags() { Flags = ImGuiNextWindowDataFlags_None; }
|
||||
};
|
||||
@ -1710,7 +1710,7 @@ IMGUI_API void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned ch
|
||||
|
||||
// Debug Tools
|
||||
// Use 'Metrics->Tools->Item Picker' to break into the call-stack of a specific item.
|
||||
#ifndef IM_DEBUG_BREAK
|
||||
#ifndef IM_DEBUG_BREAK
|
||||
#if defined(__clang__)
|
||||
#define IM_DEBUG_BREAK() __builtin_debugtrap()
|
||||
#elif defined (_MSC_VER)
|
||||
|
@ -399,37 +399,37 @@ void ImGui::BulletTextV(const char* fmt, va_list args)
|
||||
// See the series of events below and the corresponding state reported by dear imgui:
|
||||
//------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// with PressedOnClickRelease: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked()
|
||||
// Frame N+0 (mouse is outside bb) - - - - - -
|
||||
// Frame N+1 (mouse moves inside bb) - true - - - -
|
||||
// Frame N+0 (mouse is outside bb) - - - - - -
|
||||
// Frame N+1 (mouse moves inside bb) - true - - - -
|
||||
// Frame N+2 (mouse button is down) - true true true - true
|
||||
// Frame N+3 (mouse button is down) - true true - - -
|
||||
// Frame N+3 (mouse button is down) - true true - - -
|
||||
// Frame N+4 (mouse moves outside bb) - - true - - -
|
||||
// Frame N+5 (mouse moves inside bb) - true true - - -
|
||||
// Frame N+6 (mouse button is released) true true - - true -
|
||||
// Frame N+7 (mouse button is released) - true - - - -
|
||||
// Frame N+8 (mouse moves outside bb) - - - - - -
|
||||
// Frame N+6 (mouse button is released) true true - - true -
|
||||
// Frame N+7 (mouse button is released) - true - - - -
|
||||
// Frame N+8 (mouse moves outside bb) - - - - - -
|
||||
//------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// with PressedOnClick: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked()
|
||||
// Frame N+2 (mouse button is down) true true true true - true
|
||||
// Frame N+3 (mouse button is down) - true true - - -
|
||||
// Frame N+6 (mouse button is released) - true - - true -
|
||||
// Frame N+7 (mouse button is released) - true - - - -
|
||||
// Frame N+3 (mouse button is down) - true true - - -
|
||||
// Frame N+6 (mouse button is released) - true - - true -
|
||||
// Frame N+7 (mouse button is released) - true - - - -
|
||||
//------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// with PressedOnRelease: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked()
|
||||
// Frame N+2 (mouse button is down) - true - - - true
|
||||
// Frame N+3 (mouse button is down) - true - - - -
|
||||
// Frame N+3 (mouse button is down) - true - - - -
|
||||
// Frame N+6 (mouse button is released) true true - - - -
|
||||
// Frame N+7 (mouse button is released) - true - - - -
|
||||
// Frame N+7 (mouse button is released) - true - - - -
|
||||
//------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// with PressedOnDoubleClick: return-value IsItemHovered() IsItemActive() IsItemActivated() IsItemDeactivated() IsItemClicked()
|
||||
// Frame N+0 (mouse button is down) - true - - - true
|
||||
// Frame N+1 (mouse button is down) - true - - - -
|
||||
// Frame N+1 (mouse button is down) - true - - - -
|
||||
// Frame N+2 (mouse button is released) - true - - - -
|
||||
// Frame N+3 (mouse button is released) - true - - - -
|
||||
// Frame N+3 (mouse button is released) - true - - - -
|
||||
// Frame N+4 (mouse button is down) true true true true - true
|
||||
// Frame N+5 (mouse button is down) - true true - - -
|
||||
// Frame N+5 (mouse button is down) - true true - - -
|
||||
// Frame N+6 (mouse button is released) - true - - true -
|
||||
// Frame N+7 (mouse button is released) - true - - - -
|
||||
// Frame N+7 (mouse button is released) - true - - - -
|
||||
//------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Note that some combinations are supported,
|
||||
// - PressedOnDragDropHold can generally be associated with any flag.
|
||||
@ -439,7 +439,7 @@ void ImGui::BulletTextV(const char* fmt, va_list args)
|
||||
// Repeat+ Repeat+ Repeat+ Repeat+
|
||||
// PressedOnClickRelease PressedOnClick PressedOnRelease PressedOnDoubleClick
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Frame N+0 (mouse button is down) - true - true
|
||||
// Frame N+0 (mouse button is down) - true - true
|
||||
// ... - - - -
|
||||
// Frame N + RepeatDelay true true - true
|
||||
// ... - - - -
|
||||
@ -5507,7 +5507,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
|
||||
bool hovered, held;
|
||||
bool pressed = ButtonBehavior(bb, id, &hovered, &held, button_flags);
|
||||
|
||||
// Update NavId when clicking or when Hovering (this doesn't happen on most widgets), so navigation can be resumed with gamepad/keyboard
|
||||
// Update NavId when clicking or when Hovering (this doesn't happen on most widgets), so navigation can be resumed with gamepad/keyboard
|
||||
if (pressed || (hovered && (flags & ImGuiSelectableFlags_SetNavIdOnHover)))
|
||||
{
|
||||
if (!g.NavDisableMouseHover && g.NavWindow == window && g.NavLayer == window->DC.NavLayerCurrent)
|
||||
@ -7291,7 +7291,7 @@ void ImGui::PushColumnsBackground()
|
||||
return;
|
||||
window->DrawList->ChannelsSetCurrent(0);
|
||||
int cmd_size = window->DrawList->CmdBuffer.Size;
|
||||
PushClipRect(columns->HostClipRect.Min, columns->HostClipRect.Max, false);
|
||||
PushClipRect(columns->HostClipRect.Min, columns->HostClipRect.Max, false);
|
||||
IM_UNUSED(cmd_size);
|
||||
IM_ASSERT(cmd_size == window->DrawList->CmdBuffer.Size); // Being in channel 0 this should not have created an ImDrawCmd
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user