mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
Updated ImGui.
This commit is contained in:
parent
e91ab4c2c3
commit
895ebbbb9b
4 changed files with 48 additions and 25 deletions
31
3rdparty/ocornut-imgui/imgui.cpp
vendored
31
3rdparty/ocornut-imgui/imgui.cpp
vendored
|
@ -188,7 +188,7 @@
|
||||||
- 2015/03/17 (1.36) - renamed GetItemBoxMin()/GetItemBoxMax()/IsMouseHoveringBox() to GetItemRectMin()/GetItemRectMax()/IsMouseHoveringRect(). Kept inline redirection function (will obsolete).
|
- 2015/03/17 (1.36) - renamed GetItemBoxMin()/GetItemBoxMax()/IsMouseHoveringBox() to GetItemRectMin()/GetItemRectMax()/IsMouseHoveringRect(). Kept inline redirection function (will obsolete).
|
||||||
- 2015/03/15 (1.36) - renamed style.TreeNodeSpacing to style.IndentSpacing, ImGuiStyleVar_TreeNodeSpacing to ImGuiStyleVar_IndentSpacing
|
- 2015/03/15 (1.36) - renamed style.TreeNodeSpacing to style.IndentSpacing, ImGuiStyleVar_TreeNodeSpacing to ImGuiStyleVar_IndentSpacing
|
||||||
- 2015/03/13 (1.36) - renamed GetWindowIsFocused() to IsWindowFocused(). Kept inline redirection function (will obsolete).
|
- 2015/03/13 (1.36) - renamed GetWindowIsFocused() to IsWindowFocused(). Kept inline redirection function (will obsolete).
|
||||||
- 2015/03/08 (1.35) - renamed style.ScrollBarWidth to style.ScrollbarWidth
|
- 2015/03/08 (1.35) - renamed style.ScrollBarWidth to style.ScrollbarWidth (casing)
|
||||||
- 2015/02/27 (1.34) - renamed OpenNextNode(bool) to SetNextTreeNodeOpened(bool, ImGuiSetCond). Kept inline redirection function (will obsolete).
|
- 2015/02/27 (1.34) - renamed OpenNextNode(bool) to SetNextTreeNodeOpened(bool, ImGuiSetCond). Kept inline redirection function (will obsolete).
|
||||||
- 2015/02/27 (1.34) - renamed ImGuiSetCondition_*** to ImGuiSetCond_***, and _FirstUseThisSession becomes _Once.
|
- 2015/02/27 (1.34) - renamed ImGuiSetCondition_*** to ImGuiSetCond_***, and _FirstUseThisSession becomes _Once.
|
||||||
- 2015/02/11 (1.32) - changed text input callback ImGuiTextEditCallback return type from void-->int. reserved for future use, return 0 for now.
|
- 2015/02/11 (1.32) - changed text input callback ImGuiTextEditCallback return type from void-->int. reserved for future use, return 0 for now.
|
||||||
|
@ -3854,7 +3854,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
|
||||||
else if ((flags & ImGuiWindowFlags_Popup) != 0)
|
else if ((flags & ImGuiWindowFlags_Popup) != 0)
|
||||||
window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_WindowBg, bg_alpha), window_rounding);
|
window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_WindowBg, bg_alpha), window_rounding);
|
||||||
else if ((flags & ImGuiWindowFlags_ChildWindow) != 0)
|
else if ((flags & ImGuiWindowFlags_ChildWindow) != 0)
|
||||||
window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size - window->ScrollbarSizes, window->Color(ImGuiCol_ChildWindowBg, bg_alpha), window_rounding, window->ScrollbarY ? (1|8) : (0xF));
|
window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_ChildWindowBg, bg_alpha), window_rounding);
|
||||||
else
|
else
|
||||||
window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_WindowBg, bg_alpha), window_rounding);
|
window->DrawList->AddRectFilled(window->Pos, window->Pos+window->Size, window->Color(ImGuiCol_WindowBg, bg_alpha), window_rounding);
|
||||||
}
|
}
|
||||||
|
@ -3973,7 +3973,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
|
||||||
// We set this up after processing the resize grip so that our clip rectangle doesn't lag by a frame
|
// We set this up after processing the resize grip so that our clip rectangle doesn't lag by a frame
|
||||||
// Note that if our window is collapsed we will end up with a null clipping rectangle which is the correct behavior.
|
// Note that if our window is collapsed we will end up with a null clipping rectangle which is the correct behavior.
|
||||||
const ImRect title_bar_rect = window->TitleBarRect();
|
const ImRect title_bar_rect = window->TitleBarRect();
|
||||||
ImRect clip_rect(title_bar_rect.Min.x+0.5f+window->WindowPadding.x*0.5f, title_bar_rect.Max.y+window->MenuBarHeight()+0.5f, window->Pos.x+window->Size.x+0.5f-window->WindowPadding.x*0.5f, window->Pos.y+window->Size.y+0.5f);
|
ImRect clip_rect(title_bar_rect.Min.x+0.5f+window->WindowPadding.x*0.5f, title_bar_rect.Max.y+window->MenuBarHeight()+0.5f, window->Pos.x+window->Size.x-window->WindowPadding.x*0.5f, window->Pos.y+window->Size.y);
|
||||||
if ((flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_ShowBorders))
|
if ((flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_ShowBorders))
|
||||||
clip_rect.Min += ImVec2(1.0f,1.0f);
|
clip_rect.Min += ImVec2(1.0f,1.0f);
|
||||||
clip_rect.Max.x -= window->ScrollbarY ? style.ScrollbarSize : 0.0f;
|
clip_rect.Max.x -= window->ScrollbarY ? style.ScrollbarSize : 0.0f;
|
||||||
|
@ -4045,10 +4045,17 @@ static void Scrollbar(ImGuiWindow* window, bool horizontal)
|
||||||
float other_scrollbar_size_w = other_scrollbar ? style.ScrollbarSize : 0.0f;
|
float other_scrollbar_size_w = other_scrollbar ? style.ScrollbarSize : 0.0f;
|
||||||
const ImRect window_rect = window->Rect();
|
const ImRect window_rect = window->Rect();
|
||||||
ImRect bb = horizontal
|
ImRect bb = horizontal
|
||||||
? ImRect(window->Pos.x + 1, window_rect.Max.y - style.ScrollbarSize, window_rect.Max.x - 1 - other_scrollbar_size_w, window_rect.Max.y)
|
? ImRect(window->Pos.x, window_rect.Max.y - style.ScrollbarSize, window_rect.Max.x - other_scrollbar_size_w, window_rect.Max.y)
|
||||||
: ImRect(window_rect.Max.x - style.ScrollbarSize, window->Pos.y + window->TitleBarHeight()+1, window_rect.Max.x, window_rect.Max.y - 1 - other_scrollbar_size_w);
|
: ImRect(window_rect.Max.x - style.ScrollbarSize, window->Pos.y + window->TitleBarHeight(), window_rect.Max.x, window_rect.Max.y - other_scrollbar_size_w);
|
||||||
window->DrawList->AddRectFilled(bb.Min, bb.Max, window->Color(ImGuiCol_ScrollbarBg));
|
|
||||||
bb.Expand(-3.0f);
|
float window_rounding = (window->Flags & ImGuiWindowFlags_ChildWindow) ? style.ChildWindowRounding : style.WindowRounding;
|
||||||
|
int window_rounding_corners;
|
||||||
|
if (horizontal)
|
||||||
|
window_rounding_corners = 8 | (other_scrollbar ? 0 : 4);
|
||||||
|
else
|
||||||
|
window_rounding_corners = ((window->Flags & ImGuiWindowFlags_NoTitleBar) ? 2 : 0) | (other_scrollbar ? 0 : 4);
|
||||||
|
window->DrawList->AddRectFilled(bb.Min, bb.Max, window->Color(ImGuiCol_ScrollbarBg), window_rounding, window_rounding_corners);
|
||||||
|
bb.Reduce(ImVec2(ImClamp((float)(int)((bb.Max.x - bb.Min.x - 2.0f) * 0.5f), 0.0f, 3.0f), ImClamp((float)(int)((bb.Max.y - bb.Min.y - 2.0f) * 0.5f), 0.0f, 3.0f)));
|
||||||
|
|
||||||
// V denote the main axis of the scrollbar
|
// V denote the main axis of the scrollbar
|
||||||
float scrollbar_size_v = horizontal ? bb.GetWidth() : bb.GetHeight();
|
float scrollbar_size_v = horizontal ? bb.GetWidth() : bb.GetHeight();
|
||||||
|
@ -4142,9 +4149,9 @@ void ImGui::FocusWindow(ImGuiWindow* window)
|
||||||
if (g.ActiveId != 0 && g.ActiveIdWindow && g.ActiveIdWindow->RootWindow != window)
|
if (g.ActiveId != 0 && g.ActiveIdWindow && g.ActiveIdWindow->RootWindow != window)
|
||||||
ImGui::SetActiveID(0);
|
ImGui::SetActiveID(0);
|
||||||
|
|
||||||
if (g.Windows.back() == window)
|
// Bring to front
|
||||||
|
if ((window->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus) || g.Windows.back() == window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < g.Windows.Size; i++)
|
for (int i = 0; i < g.Windows.Size; i++)
|
||||||
if (g.Windows[i] == window)
|
if (g.Windows[i] == window)
|
||||||
{
|
{
|
||||||
|
@ -5814,8 +5821,8 @@ static void DataTypeApplyOpFromText(const char* buf, const char* initial_value_b
|
||||||
}
|
}
|
||||||
else if (data_type == ImGuiDataType_Float)
|
else if (data_type == ImGuiDataType_Float)
|
||||||
{
|
{
|
||||||
if (!scalar_format)
|
// For floats we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in
|
||||||
scalar_format = "%f";
|
scalar_format = "%f";
|
||||||
float* v = (float*)data_ptr;
|
float* v = (float*)data_ptr;
|
||||||
float ref_v = *v;
|
float ref_v = *v;
|
||||||
if (op && sscanf(initial_value_buf, scalar_format, &ref_v) < 1)
|
if (op && sscanf(initial_value_buf, scalar_format, &ref_v) < 1)
|
||||||
|
@ -7642,7 +7649,7 @@ bool ImGui::InputFloat(const char* label, float* v, float step, float step_fast,
|
||||||
if (decimal_precision < 0)
|
if (decimal_precision < 0)
|
||||||
strcpy(display_format, "%f"); // Ideally we'd have a minimum decimal precision of 1 to visually denote that this is a float, while hiding non-significant digits? %f doesn't have a minimum of 1
|
strcpy(display_format, "%f"); // Ideally we'd have a minimum decimal precision of 1 to visually denote that this is a float, while hiding non-significant digits? %f doesn't have a minimum of 1
|
||||||
else
|
else
|
||||||
ImFormatString(display_format, 16, "%%%df", decimal_precision);
|
ImFormatString(display_format, 16, "%%.%df", decimal_precision);
|
||||||
return InputScalarEx(label, ImGuiDataType_Float, (void*)v, (void*)(step>0.0f ? &step : NULL), (void*)(step_fast>0.0f ? &step_fast : NULL), display_format, extra_flags);
|
return InputScalarEx(label, ImGuiDataType_Float, (void*)v, (void*)(step>0.0f ? &step : NULL), (void*)(step_fast>0.0f ? &step_fast : NULL), display_format, extra_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
22
3rdparty/ocornut-imgui/imgui.h
vendored
22
3rdparty/ocornut-imgui/imgui.h
vendored
|
@ -115,11 +115,11 @@ namespace ImGui
|
||||||
IMGUI_API void ShowMetricsWindow(bool* opened = NULL); // metrics window for debugging imgui
|
IMGUI_API void ShowMetricsWindow(bool* opened = NULL); // metrics window for debugging imgui
|
||||||
|
|
||||||
// Window
|
// Window
|
||||||
IMGUI_API bool Begin(const char* name, bool* p_opened = NULL, ImGuiWindowFlags flags = 0); // see .cpp for details. return false when window is collapsed, so you can early out in your code. 'bool* p_opened' creates a widget on the upper-right to close the window (which sets your bool to false).
|
IMGUI_API bool Begin(const char* name, bool* p_opened = NULL, ImGuiWindowFlags flags = 0); // see .cpp for details. return false when window is collapsed, so you can early out in your code. 'bool* p_opened' creates a widget on the upper-right to close the window (which sets your bool to false).
|
||||||
IMGUI_API bool Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_use, float bg_alpha = -1.0f, ImGuiWindowFlags flags = 0); // this is the older/longer API. call SetNextWindowSize() instead if you want to set a window size. For regular windows, 'size_on_first_use' only applies to the first time EVER the window is created and probably not what you want! maybe obsolete this API eventually.
|
IMGUI_API bool Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_use, float bg_alpha = -1.0f, ImGuiWindowFlags flags = 0); // this is the older/longer API. the extra parameters aren't very relevant. call SetNextWindowSize() instead if you want to set a window size. For regular windows, 'size_on_first_use' only applies to the first time EVER the window is created and probably not what you want! maybe obsolete this API eventually.
|
||||||
IMGUI_API void End();
|
IMGUI_API void End();
|
||||||
IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400).
|
IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400).
|
||||||
IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // "
|
IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // "
|
||||||
IMGUI_API void EndChild();
|
IMGUI_API void EndChild();
|
||||||
IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
|
IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
|
||||||
IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos()
|
IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos()
|
||||||
|
@ -458,6 +458,7 @@ enum ImGuiWindowFlags_
|
||||||
ImGuiWindowFlags_MenuBar = 1 << 10, // Has a menu-bar
|
ImGuiWindowFlags_MenuBar = 1 << 10, // Has a menu-bar
|
||||||
ImGuiWindowFlags_HorizontalScrollbar = 1 << 11, // Enable horizontal scrollbar (off by default). You need to use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section.
|
ImGuiWindowFlags_HorizontalScrollbar = 1 << 11, // Enable horizontal scrollbar (off by default). You need to use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section.
|
||||||
ImGuiWindowFlags_NoFocusOnAppearing = 1 << 12, // Disable taking focus when transitioning from hidden to visible state
|
ImGuiWindowFlags_NoFocusOnAppearing = 1 << 12, // Disable taking focus when transitioning from hidden to visible state
|
||||||
|
ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13, // Disable bringing window to front when taking focus (e.g. clicking on it or programatically giving it focus)
|
||||||
// [Internal]
|
// [Internal]
|
||||||
ImGuiWindowFlags_ChildWindow = 1 << 20, // Don't use! For internal use by BeginChild()
|
ImGuiWindowFlags_ChildWindow = 1 << 20, // Don't use! For internal use by BeginChild()
|
||||||
ImGuiWindowFlags_ChildWindowAutoFitX = 1 << 21, // Don't use! For internal use by BeginChild()
|
ImGuiWindowFlags_ChildWindowAutoFitX = 1 << 21, // Don't use! For internal use by BeginChild()
|
||||||
|
@ -1160,7 +1161,7 @@ struct ImDrawData
|
||||||
int TotalIdxCount; // For convenience, sum of all cmd_lists idx_buffer.Size
|
int TotalIdxCount; // For convenience, sum of all cmd_lists idx_buffer.Size
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
IMGUI_API ImDrawData() { Valid = false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; }
|
ImDrawData() { Valid = false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; }
|
||||||
IMGUI_API void DeIndexAllBuffers(); // For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
|
IMGUI_API void DeIndexAllBuffers(); // For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
|
||||||
IMGUI_API void ScaleClipRects(const ImVec2& sc); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
|
IMGUI_API void ScaleClipRects(const ImVec2& sc); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
|
||||||
};
|
};
|
||||||
|
@ -1216,11 +1217,12 @@ struct ImFontAtlas
|
||||||
// Pitch = Width * BytesPerPixels
|
// Pitch = Width * BytesPerPixels
|
||||||
IMGUI_API void GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 1 byte per-pixel
|
IMGUI_API void GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 1 byte per-pixel
|
||||||
IMGUI_API void GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 4 bytes-per-pixel
|
IMGUI_API void GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 4 bytes-per-pixel
|
||||||
IMGUI_API void SetTexID(void* id) { TexID = id; }
|
void SetTexID(void* id) { TexID = id; }
|
||||||
|
|
||||||
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
|
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
|
||||||
// (Those functions could be static but aren't so most users don't have to refer to the ImFontAtlas:: name ever if in their code; just using io.Fonts->)
|
// (Those functions could be static but aren't so most users don't have to refer to the ImFontAtlas:: name ever if in their code; just using io.Fonts->)
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin
|
IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin
|
||||||
|
IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
|
IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesChinese(); // Japanese + full set of about 21000 CJK Unified Ideographs
|
IMGUI_API const ImWchar* GetGlyphRangesChinese(); // Japanese + full set of about 21000 CJK Unified Ideographs
|
||||||
IMGUI_API const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters
|
IMGUI_API const ImWchar* GetGlyphRangesCyrillic(); // Default + about 400 Cyrillic characters
|
||||||
|
@ -1267,18 +1269,18 @@ struct ImFont
|
||||||
ImVector<Glyph> Glyphs;
|
ImVector<Glyph> Glyphs;
|
||||||
const Glyph* FallbackGlyph; // == FindGlyph(FontFallbackChar)
|
const Glyph* FallbackGlyph; // == FindGlyph(FontFallbackChar)
|
||||||
float FallbackXAdvance; //
|
float FallbackXAdvance; //
|
||||||
ImVector<float> IndexXAdvance; // Sparse. Glyphs->XAdvance directly indexable (for CalcTextSize functions which are often bottleneck in large UI)
|
ImVector<float> IndexXAdvance; // Sparse. Glyphs->XAdvance directly indexable (more cache-friendly that reading from Glyphs, for CalcTextSize functions which are often bottleneck in large UI)
|
||||||
ImVector<int> IndexLookup; // Sparse. Index glyphs by Unicode code-point
|
ImVector<int> IndexLookup; // Sparse. Index glyphs by Unicode code-point.
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
IMGUI_API ImFont();
|
IMGUI_API ImFont();
|
||||||
IMGUI_API ~ImFont();
|
IMGUI_API ~ImFont();
|
||||||
IMGUI_API void Clear();
|
IMGUI_API void Clear();
|
||||||
IMGUI_API void BuildLookupTable();
|
IMGUI_API void BuildLookupTable();
|
||||||
IMGUI_API float GetCharAdvance(unsigned short c) const { return ((int)c < IndexXAdvance.Size) ? IndexXAdvance[(int)c] : FallbackXAdvance; }
|
|
||||||
IMGUI_API const Glyph* FindGlyph(unsigned short c) const;
|
IMGUI_API const Glyph* FindGlyph(unsigned short c) const;
|
||||||
IMGUI_API void SetFallbackChar(ImWchar c);
|
IMGUI_API void SetFallbackChar(ImWchar c);
|
||||||
IMGUI_API bool IsLoaded() const { return ContainerAtlas != NULL; }
|
float GetCharAdvance(unsigned short c) const { return ((int)c < IndexXAdvance.Size) ? IndexXAdvance[(int)c] : FallbackXAdvance; }
|
||||||
|
bool IsLoaded() const { return ContainerAtlas != NULL; }
|
||||||
|
|
||||||
// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
|
// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
|
||||||
// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
||||||
|
|
6
3rdparty/ocornut-imgui/imgui_demo.cpp
vendored
6
3rdparty/ocornut-imgui/imgui_demo.cpp
vendored
|
@ -966,10 +966,12 @@ void ImGui::ShowTestWindow(bool* opened)
|
||||||
{
|
{
|
||||||
ImGui::Bullet(); ImGui::TextWrapped("Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.");
|
ImGui::Bullet(); ImGui::TextWrapped("Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.");
|
||||||
ImGui::Bullet(); ImGui::TextWrapped("You may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin().");
|
ImGui::Bullet(); ImGui::TextWrapped("You may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin().");
|
||||||
|
static int lines = 7;
|
||||||
|
ImGui::SliderInt("Lines", &lines, 1, 15);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
|
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f));
|
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f));
|
||||||
ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetItemsLineHeightWithSpacing()*7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar);
|
ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetItemsLineHeightWithSpacing()*7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar);
|
||||||
for (int line = 0; line < 7; line++)
|
for (int line = 0; line < lines; line++)
|
||||||
{
|
{
|
||||||
// Display random stuff
|
// Display random stuff
|
||||||
int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
|
int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
|
||||||
|
@ -1479,7 +1481,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||||
ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f");
|
ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f");
|
||||||
ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f");
|
ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f");
|
||||||
ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f");
|
ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f");
|
||||||
ImGui::SliderFloat("ScrollbarWidth", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
|
ImGui::SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
|
||||||
ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 16.0f, "%.0f");
|
ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 16.0f, "%.0f");
|
||||||
ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f");
|
ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f");
|
||||||
ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 16.0f, "%.0f");
|
ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 16.0f, "%.0f");
|
||||||
|
|
14
3rdparty/ocornut-imgui/imgui_draw.cpp
vendored
14
3rdparty/ocornut-imgui/imgui_draw.cpp
vendored
|
@ -713,7 +713,7 @@ void ImDrawList::PathRect(const ImVec2& a, const ImVec2& b, float rounding, int
|
||||||
r = ImMin(r, fabsf(b.x-a.x) * ( ((rounding_corners&(1|2))==(1|2)) || ((rounding_corners&(4|8))==(4|8)) ? 0.5f : 1.0f ) - 1.0f);
|
r = ImMin(r, fabsf(b.x-a.x) * ( ((rounding_corners&(1|2))==(1|2)) || ((rounding_corners&(4|8))==(4|8)) ? 0.5f : 1.0f ) - 1.0f);
|
||||||
r = ImMin(r, fabsf(b.y-a.y) * ( ((rounding_corners&(1|8))==(1|8)) || ((rounding_corners&(2|4))==(2|4)) ? 0.5f : 1.0f ) - 1.0f);
|
r = ImMin(r, fabsf(b.y-a.y) * ( ((rounding_corners&(1|8))==(1|8)) || ((rounding_corners&(2|4))==(2|4)) ? 0.5f : 1.0f ) - 1.0f);
|
||||||
|
|
||||||
if (r == 0.0f || rounding_corners == 0)
|
if (r <= 0.0f || rounding_corners == 0)
|
||||||
{
|
{
|
||||||
PathLineTo(a);
|
PathLineTo(a);
|
||||||
PathLineTo(ImVec2(b.x,a.y));
|
PathLineTo(ImVec2(b.x,a.y));
|
||||||
|
@ -1458,6 +1458,18 @@ const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
|
||||||
return &ranges[0];
|
return &ranges[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImWchar* ImFontAtlas::GetGlyphRangesKorean()
|
||||||
|
{
|
||||||
|
static const ImWchar ranges[] =
|
||||||
|
{
|
||||||
|
0x0020, 0x00FF, // Basic Latin + Latin Supplement
|
||||||
|
0x3131, 0x3163, // Korean alphabets
|
||||||
|
0xAC00, 0xD79D, // Korean characters
|
||||||
|
0,
|
||||||
|
};
|
||||||
|
return &ranges[0];
|
||||||
|
}
|
||||||
|
|
||||||
const ImWchar* ImFontAtlas::GetGlyphRangesChinese()
|
const ImWchar* ImFontAtlas::GetGlyphRangesChinese()
|
||||||
{
|
{
|
||||||
static const ImWchar ranges[] =
|
static const ImWchar ranges[] =
|
||||||
|
|
Loading…
Reference in a new issue