Trim trailing spaces
This commit is contained in:
parent
d6750c87c2
commit
2b7eeba143
38
imgui.cpp
38
imgui.cpp
@ -108,7 +108,7 @@
|
||||
unsigned char* pixels;
|
||||
int width, height;
|
||||
io.Fonts->GetTexDataAsRGBA32(pixels, &width, &height);
|
||||
// TODO: At this points you've got a texture pointed to by 'pixels' and you need to upload that your your graphic system
|
||||
// TODO: At this points you've got a texture pointed to by 'pixels' and you need to upload that your your graphic system
|
||||
// TODO: Store your texture pointer/identifier (whatever your engine uses) in 'io.Fonts->TexID'
|
||||
|
||||
// Application main loop
|
||||
@ -309,7 +309,7 @@
|
||||
|
||||
Button("Hello###ID"; // Label = "Hello", ID = hash of "ID"
|
||||
Button("World###ID"; // Label = "World", ID = hash of "ID" (same as above)
|
||||
|
||||
|
||||
sprintf(buf, "My game (%f FPS)###MyGame");
|
||||
Begin(buf); // Variable label, ID = hash of "MyGame"
|
||||
|
||||
@ -447,7 +447,7 @@
|
||||
- widgets: clean up widgets internal toward exposing everything.
|
||||
- widgets: add disabled and read-only modes (#211)
|
||||
- main: considering adding EndFrame()/Init(). some constructs are awkward in the implementation because of the lack of them.
|
||||
- main: make it so that a frame with no window registered won't refocus every window on subsequent frames (~bump LastFrameActive of all windows).
|
||||
- main: make it so that a frame with no window registered won't refocus every window on subsequent frames (~bump LastFrameActive of all windows).
|
||||
- main: IsItemHovered() make it more consistent for various type of widgets, widgets with multiple components, etc. also effectively IsHovered() region sometimes differs from hot region, e.g tree nodes
|
||||
- main: IsItemHovered() info stored in a stack? so that 'if TreeNode() { Text; TreePop; } if IsHovered' return the hover state of the TreeNode?
|
||||
- input text: add ImGuiInputTextFlags_EnterToApply? (off #218)
|
||||
@ -984,7 +984,7 @@ int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char*
|
||||
if ((*str & 0xf0) == 0xe0)
|
||||
{
|
||||
*out_char = 0xFFFD; // will be invalid but not end of string
|
||||
if (in_text_end && in_text_end - (const char*)str < 3) return 1;
|
||||
if (in_text_end && in_text_end - (const char*)str < 3) return 1;
|
||||
if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf)) return 3;
|
||||
if (*str == 0xed && str[1] > 0x9f) return 3; // str[1] < 0x80 is checked below
|
||||
c = (unsigned int)((*str++ & 0x0f) << 12);
|
||||
@ -2388,7 +2388,7 @@ void ImGui::EndFrame()
|
||||
// Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME)
|
||||
if (g.IO.ImeSetInputScreenPosFn && ImLengthSqr(g.OsImePosRequest - g.OsImePosSet) > 0.0001f)
|
||||
{
|
||||
g.IO.ImeSetInputScreenPosFn((int)g.OsImePosRequest.x, (int)g.OsImePosRequest.y);
|
||||
g.IO.ImeSetInputScreenPosFn((int)g.OsImePosRequest.x, (int)g.OsImePosRequest.y);
|
||||
g.OsImePosSet = g.OsImePosRequest;
|
||||
}
|
||||
|
||||
@ -3141,7 +3141,7 @@ static bool IsPopupOpen(ImGuiID id)
|
||||
return opened;
|
||||
}
|
||||
|
||||
// Mark popup as open (toggle toward open state).
|
||||
// Mark popup as open (toggle toward open state).
|
||||
// Popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block.
|
||||
// Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
|
||||
// One open popup per level of the popup hierarchy (NB: when assigning we reset the Window member of ImGuiPopupRef to NULL)
|
||||
@ -3319,11 +3319,11 @@ void ImGui::EndPopup()
|
||||
}
|
||||
|
||||
// This is a helper to handle the most simple case of associating one named popup to one given widget.
|
||||
// 1. If you have many possible popups (for different "instances" of a same widget, or for wholly different widgets), you may be better off handling
|
||||
// 1. If you have many possible popups (for different "instances" of a same widget, or for wholly different widgets), you may be better off handling
|
||||
// this yourself so you can store data relative to the widget that opened the popup instead of choosing different popup identifiers.
|
||||
// 2. If you want right-clicking on the same item to reopen the popup at new location, use the same code replacing IsItemHovered() with IsItemHoveredRect()
|
||||
// and passing true to the OpenPopupEx().
|
||||
// Because: hovering an item in a window below the popup won't normally trigger is hovering behavior/coloring. The pattern of ignoring the fact that
|
||||
// Because: hovering an item in a window below the popup won't normally trigger is hovering behavior/coloring. The pattern of ignoring the fact that
|
||||
// the item isn't interactable (because it is blocked by the active popup) may useful in some situation when e.g. large canvas as one item, content of menu
|
||||
// driven by click position.
|
||||
bool ImGui::BeginPopupContextItem(const char* str_id, int mouse_button)
|
||||
@ -3482,7 +3482,7 @@ static ImVec2 FindBestPopupWindowPos(const ImVec2& base_pos, const ImVec2& size,
|
||||
|
||||
ImGuiWindow* ImGui::FindWindowByName(const char* name)
|
||||
{
|
||||
// FIXME-OPT: Store sorted hashes -> pointers so we can do a bissection in a contiguous block
|
||||
// FIXME-OPT: Store sorted hashes -> pointers so we can do a bissection in a contiguous block
|
||||
ImGuiState& g = *GImGui;
|
||||
ImGuiID id = ImHash(name, 0);
|
||||
for (int i = 0; i < g.Windows.Size; i++)
|
||||
@ -3615,7 +3615,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
|
||||
g.CurrentPopupStack.push_back(popup_ref);
|
||||
window->PopupID = popup_ref.PopupID;
|
||||
}
|
||||
|
||||
|
||||
const bool window_appearing_after_being_hidden = (window->HiddenFrames == 1);
|
||||
|
||||
// Process SetNextWindow***() calls
|
||||
@ -3763,7 +3763,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
|
||||
else
|
||||
{
|
||||
size_auto_fit = ImClamp(window->SizeContents + window->WindowPadding, style.WindowMinSize, ImMax(style.WindowMinSize, g.IO.DisplaySize - g.Style.DisplaySafeAreaPadding));
|
||||
|
||||
|
||||
// Handling case of auto fit window not fitting in screen on one axis, we are growing auto fit size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than DisplaySize-WindowPadding.
|
||||
if (size_auto_fit.x < window->SizeContents.x && !(flags & ImGuiWindowFlags_NoScrollbar) && (flags & ImGuiWindowFlags_HorizontalScrollbar))
|
||||
size_auto_fit.y += style.ScrollbarSize;
|
||||
@ -5637,7 +5637,7 @@ bool ImGui::CollapsingHeader(const char* label, const char* str_id, bool display
|
||||
label = str_id;
|
||||
const bool label_hide_text_after_double_hash = (label == str_id); // Only search and hide text after ## if we have passed label and ID separately, otherwise allow "##" within format string.
|
||||
const ImGuiID id = window->GetID(str_id);
|
||||
const ImVec2 label_size = CalcTextSize(label, NULL, label_hide_text_after_double_hash);
|
||||
const ImVec2 label_size = CalcTextSize(label, NULL, label_hide_text_after_double_hash);
|
||||
|
||||
// We vertically grow up to current line height up the typical widget height.
|
||||
const float text_base_offset_y = ImMax(0.0f, window->DC.CurrentLineTextBaseOffset - padding.y); // Latch before ItemSize changes it
|
||||
@ -6871,7 +6871,7 @@ void ImGui::ProgressBar(float fraction, const ImVec2& size_arg, const char* over
|
||||
ImFormatString(overlay_buf, IM_ARRAYSIZE(overlay_buf), "%.0f%%", fraction*100+0.01f);
|
||||
overlay = overlay_buf;
|
||||
}
|
||||
|
||||
|
||||
ImVec2 overlay_size = CalcTextSize(overlay, NULL);
|
||||
if (overlay_size.x > 0.0f)
|
||||
RenderTextClipped(ImVec2(ImClamp(fill_br.x + style.ItemSpacing.x, bb.Min.x, bb.Max.x - overlay_size.x - style.ItemInnerSpacing.x), bb.Min.y), bb.Max, overlay, NULL, &overlay_size, ImGuiAlign_Left|ImGuiAlign_VCenter, &bb.Min, &bb.Max);
|
||||
@ -6936,7 +6936,7 @@ bool ImGui::CheckboxFlags(const char* label, unsigned int* flags, unsigned int f
|
||||
else
|
||||
*flags &= ~flags_value;
|
||||
}
|
||||
|
||||
|
||||
return pressed;
|
||||
}
|
||||
|
||||
@ -7771,7 +7771,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
|
||||
|
||||
// Notify OS of text input position for advanced IME (-1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.)
|
||||
if (is_editable)
|
||||
g.OsImePosRequest = ImVec2(cursor_screen_pos.x - 1, cursor_screen_pos.y - g.FontSize);
|
||||
g.OsImePosRequest = ImVec2(cursor_screen_pos.x - 1, cursor_screen_pos.y - g.FontSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -8663,7 +8663,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], bool alpha)
|
||||
const ImVec4 col_display(col[0], col[1], col[2], 1.0f);
|
||||
if (ImGui::ColorButton(col_display))
|
||||
g.ColorEditModeStorage.SetInt(id, (edit_mode + 1) % 3); // Don't set local copy of 'edit_mode' right away!
|
||||
|
||||
|
||||
// Recreate our own tooltip over's ColorButton() one because we want to display correct alpha here
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("Color:\n(%.2f,%.2f,%.2f,%.2f)\n#%02X%02X%02X%02X", col[0], col[1], col[2], col[3], IM_F32_TO_INT8(col[0]), IM_F32_TO_INT8(col[1]), IM_F32_TO_INT8(col[2]), IM_F32_TO_INT8(col[3]));
|
||||
@ -8760,7 +8760,7 @@ void ImGui::Dummy(const ImVec2& size)
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
if (window->SkipItems)
|
||||
return;
|
||||
|
||||
|
||||
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
|
||||
ItemSize(bb);
|
||||
ItemAdd(bb, NULL);
|
||||
@ -9022,9 +9022,9 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
|
||||
}
|
||||
}
|
||||
|
||||
// Differentiate column ID with an arbitrary prefix for cases where users name their columns set the same as another widget.
|
||||
// Differentiate column ID with an arbitrary prefix for cases where users name their columns set the same as another widget.
|
||||
// In addition, when an identifier isn't explicitly provided we include the number of columns in the hash to make it uniquer.
|
||||
ImGui::PushID(0x11223347 + (id ? 0 : columns_count));
|
||||
ImGui::PushID(0x11223347 + (id ? 0 : columns_count));
|
||||
window->DC.ColumnsSetID = window->GetID(id ? id : "columns");
|
||||
ImGui::PopID();
|
||||
|
||||
|
10
imgui.h
10
imgui.h
@ -105,7 +105,7 @@ namespace ImGui
|
||||
IMGUI_API ImGuiStyle& GetStyle();
|
||||
IMGUI_API ImDrawData* GetDrawData(); // same value as passed to your io.RenderDrawListsFn() function. valid after Render() and until the next call to NewFrame().
|
||||
IMGUI_API void NewFrame();
|
||||
IMGUI_API void Render(); // finalize rendering data, then call your io.RenderDrawListsFn() function if set.
|
||||
IMGUI_API void Render(); // finalize rendering data, then call your io.RenderDrawListsFn() function if set.
|
||||
IMGUI_API void Shutdown();
|
||||
IMGUI_API void ShowUserGuide(); // help block
|
||||
IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // style editor block
|
||||
@ -124,7 +124,7 @@ namespace ImGui
|
||||
IMGUI_API float GetContentRegionAvailWidth(); //
|
||||
IMGUI_API ImVec2 GetWindowContentRegionMin(); // content boundaries min (roughly (0,0)-Scroll), in window coordinates
|
||||
IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates
|
||||
IMGUI_API float GetWindowContentRegionWidth(); //
|
||||
IMGUI_API float GetWindowContentRegionWidth(); //
|
||||
IMGUI_API ImDrawList* GetWindowDrawList(); // get rendering command-list if you want to append your own draw primitives
|
||||
IMGUI_API ImVec2 GetWindowPos(); // get current window position in screen space (useful if you want to do your own drawing via the DrawList api)
|
||||
IMGUI_API ImVec2 GetWindowSize(); // get current window size
|
||||
@ -137,7 +137,7 @@ namespace ImGui
|
||||
IMGUI_API void SetNextWindowPosCenter(ImGuiSetCond cond = 0); // set next window position to be centered on screen. call before Begin()
|
||||
IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
|
||||
IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (enforce the range of scrollbars). set axis to 0.0f to leave it automatic. call before Begin()
|
||||
IMGUI_API void SetNextWindowContentWidth(float width); // set next window content width (enforce the range of horizontal scrollbar). call before Begin()
|
||||
IMGUI_API void SetNextWindowContentWidth(float width); // set next window content width (enforce the range of horizontal scrollbar). call before Begin()
|
||||
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0); // set next window collapsed state. call before Begin()
|
||||
IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most. call before Begin()
|
||||
IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0); // set current window position - call within Begin()/End(). may incur tearing
|
||||
@ -351,7 +351,7 @@ namespace ImGui
|
||||
IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true); // return true when activated + toggle (*p_selected) if p_selected != NULL
|
||||
|
||||
// Popups
|
||||
IMGUI_API void OpenPopup(const char* str_id); // mark popup as open. popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
|
||||
IMGUI_API void OpenPopup(const char* str_id); // mark popup as open. popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
|
||||
IMGUI_API bool BeginPopup(const char* str_id); // return true if popup if opened and start outputting to it. only call EndPopup() if BeginPopup() returned true!
|
||||
IMGUI_API bool BeginPopupModal(const char* name, bool* p_opened = NULL, ImGuiWindowFlags extra_flags = 0); // modal dialog (can't close them by clicking outside)
|
||||
IMGUI_API bool BeginPopupContextItem(const char* str_id, int mouse_button = 1); // helper to open and begin popup when clicked on last item. read comments in .cpp!
|
||||
@ -711,7 +711,7 @@ struct ImGuiIO
|
||||
// User Functions
|
||||
//------------------------------------------------------------------
|
||||
|
||||
// Rendering function, will be called in Render().
|
||||
// Rendering function, will be called in Render().
|
||||
// Alternatively you can keep this to NULL and call GetDrawData() after Render() to get the same pointer.
|
||||
// See example applications if you are unsure of how to implement this.
|
||||
void (*RenderDrawListsFn)(ImDrawData* data);
|
||||
|
@ -443,7 +443,7 @@ void ImGui::ShowTestWindow(bool* p_opened)
|
||||
static char buf6[64] = ""; ImGui::InputText("\"imgui\" letters", buf6, 64, ImGuiInputTextFlags_CallbackCharFilter, TextFilters::FilterImGuiLetters);
|
||||
|
||||
ImGui::Text("Password input");
|
||||
static char bufpass[64] = "password123";
|
||||
static char bufpass[64] = "password123";
|
||||
ImGui::InputText("password", bufpass, 64, ImGuiInputTextFlags_Password | ImGuiInputTextFlags_CharsNoBlank);
|
||||
ImGui::SameLine(); ShowHelpMarker("Display all characters as '*'.\nDisable clipboard cut and copy.\nDisable logging.\n");
|
||||
ImGui::InputText("password (clear)", bufpass, 64, ImGuiInputTextFlags_CharsNoBlank);
|
||||
@ -454,7 +454,7 @@ void ImGui::ShowTestWindow(bool* p_opened)
|
||||
if (ImGui::TreeNode("Multi-line Text Input"))
|
||||
{
|
||||
static bool read_only = false;
|
||||
static char text[1024*16] =
|
||||
static char text[1024*16] =
|
||||
"/*\n"
|
||||
" The Pentium F00F bug, shorthand for F0 0F C7 C8,\n"
|
||||
" the hexadecimal encoding of one offending instruction,\n"
|
||||
@ -816,7 +816,7 @@ void ImGui::ShowTestWindow(bool* p_opened)
|
||||
if (ImGui::TreeNode("Widgets Width"))
|
||||
{
|
||||
static float f = 0.0f;
|
||||
ImGui::Text("PushItemWidth(100)");
|
||||
ImGui::Text("PushItemWidth(100)");
|
||||
ImGui::SameLine(); ShowHelpMarker("Fixed width.");
|
||||
ImGui::PushItemWidth(100);
|
||||
ImGui::DragFloat("float##1", &f);
|
||||
@ -996,8 +996,8 @@ void ImGui::ShowTestWindow(bool* p_opened)
|
||||
|
||||
// Tree
|
||||
const float spacing = ImGui::GetStyle().ItemInnerSpacing.x;
|
||||
ImGui::Button("Button##1");
|
||||
ImGui::SameLine(0.0f, spacing);
|
||||
ImGui::Button("Button##1");
|
||||
ImGui::SameLine(0.0f, spacing);
|
||||
if (ImGui::TreeNode("Node##1")) { for (int i = 0; i < 6; i++) ImGui::BulletText("Item %d..", i); ImGui::TreePop(); } // Dummy tree data
|
||||
|
||||
ImGui::AlignFirstTextHeightToWidgets(); // Vertically align text node a bit lower so it'll be vertically centered with upcoming widget. Otherwise you can use SmallButton (smaller fit).
|
||||
@ -1006,8 +1006,8 @@ void ImGui::ShowTestWindow(bool* p_opened)
|
||||
if (tree_opened) { for (int i = 0; i < 6; i++) ImGui::BulletText("Item %d..", i); ImGui::TreePop(); } // Dummy tree data
|
||||
|
||||
// Bullet
|
||||
ImGui::Button("Button##3");
|
||||
ImGui::SameLine(0.0f, spacing);
|
||||
ImGui::Button("Button##3");
|
||||
ImGui::SameLine(0.0f, spacing);
|
||||
ImGui::BulletText("Bullet text");
|
||||
|
||||
ImGui::AlignFirstTextHeightToWidgets();
|
||||
@ -1086,7 +1086,7 @@ void ImGui::ShowTestWindow(bool* p_opened)
|
||||
ImGui::PopStyleVar(2);
|
||||
float scroll_x_delta = 0.0f;
|
||||
ImGui::SmallButton("<<"); if (ImGui::IsItemActive()) scroll_x_delta = -ImGui::GetIO().DeltaTime * 1000.0f;
|
||||
ImGui::SameLine(); ImGui::Text("Scroll from code"); ImGui::SameLine();
|
||||
ImGui::SameLine(); ImGui::Text("Scroll from code"); ImGui::SameLine();
|
||||
ImGui::SmallButton(">>"); if (ImGui::IsItemActive()) scroll_x_delta = +ImGui::GetIO().DeltaTime * 1000.0f;
|
||||
if (scroll_x_delta != 0.0f)
|
||||
{
|
||||
@ -1181,7 +1181,7 @@ void ImGui::ShowTestWindow(bool* p_opened)
|
||||
ImGui::Spacing();
|
||||
ImGui::TextWrapped("Below we are testing adding menu items to a regular window. It's rather unusual but should work!");
|
||||
ImGui::Separator();
|
||||
// NB: As a quirk in this very specific example, we want to differentiate the parent of this menu from the parent of the various popup menus above.
|
||||
// NB: As a quirk in this very specific example, we want to differentiate the parent of this menu from the parent of the various popup menus above.
|
||||
// To do so we are encloding the items in a PushID()/PopID() block to make them two different menusets. If we don't, opening any popup above and hovering our menu here
|
||||
// would open it. This is because once a menu is active, we allow to switch to a sibling menu by just hovering on it, which is the desired behavior for regular menus.
|
||||
ImGui::PushID("foo");
|
||||
@ -1396,7 +1396,7 @@ void ImGui::ShowTestWindow(bool* p_opened)
|
||||
ImGui::SameLine(); ShowHelpMarker("NB: Tree node must be poped before ending the cell.\nThere's no storage of state per-cell.");
|
||||
if (node_opened)
|
||||
{
|
||||
ImGui::Columns(2, "tree items");
|
||||
ImGui::Columns(2, "tree items");
|
||||
ImGui::Separator();
|
||||
if (ImGui::TreeNode("Hello")) { ImGui::BulletText("Sailor"); ImGui::TreePop(); } ImGui::NextColumn();
|
||||
if (ImGui::TreeNode("Bonjour")) { ImGui::BulletText("Marin"); ImGui::TreePop(); } ImGui::NextColumn();
|
||||
@ -1513,7 +1513,7 @@ void ImGui::ShowTestWindow(bool* p_opened)
|
||||
ImGui::Button("Holding me clears the\nthe keyboard capture flag");
|
||||
if (ImGui::IsItemActive())
|
||||
ImGui::CaptureKeyboardFromApp(false);
|
||||
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
@ -1798,7 +1798,7 @@ static void ShowExampleAppCustomRendering(bool* opened)
|
||||
ImGui::Text("Primitives");
|
||||
static float sz = 36.0f;
|
||||
static ImVec4 col = ImVec4(1.0f,1.0f,0.4f,1.0f);
|
||||
ImGui::DragFloat("Size", &sz, 0.2f, 2.0f, 72.0f, "%.0f");
|
||||
ImGui::DragFloat("Size", &sz, 0.2f, 2.0f, 72.0f, "%.0f");
|
||||
ImGui::ColorEdit3("Color", &col.x);
|
||||
{
|
||||
const ImVec2 p = ImGui::GetCursorScreenPos();
|
||||
@ -2305,7 +2305,7 @@ static void ShowExampleAppPropertyEditor(bool* opened)
|
||||
ImGui::AlignFirstTextHeightToWidgets();
|
||||
ImGui::Text("my sailor is rich");
|
||||
ImGui::NextColumn();
|
||||
if (opened)
|
||||
if (opened)
|
||||
{
|
||||
static float dummy_members[8] = { 0.0f,0.0f,1.0f,3.1416f,100.0f,999.0f };
|
||||
for (int i = 0; i < 8; i++)
|
||||
@ -2338,7 +2338,7 @@ static void ShowExampleAppPropertyEditor(bool* opened)
|
||||
ImGui::TreePop();
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Iterate dummy objects with dummy members (all the same data)
|
||||
|
@ -202,7 +202,7 @@ void ImDrawList::UpdateTextureID()
|
||||
AddDrawCmd();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Try to merge with previous command if it matches, else use current command
|
||||
ImDrawCmd* prev_cmd = CmdBuffer.Size > 1 ? curr_cmd - 1 : NULL;
|
||||
if (prev_cmd && prev_cmd->TextureId == curr_texture_id && memcmp(&prev_cmd->ClipRect, &GetCurrentClipRect(), sizeof(ImVec4)) == 0 && prev_cmd->UserCallback == NULL)
|
||||
@ -702,11 +702,11 @@ static void PathBezierToCasteljau(ImVector<ImVec2>* path, float x1, float y1, fl
|
||||
{
|
||||
float dx = x4 - x1;
|
||||
float dy = y4 - y1;
|
||||
float d2 = ((x2 - x4) * dy - (y2 - y4) * dx);
|
||||
float d3 = ((x3 - x4) * dy - (y3 - y4) * dx);
|
||||
float d2 = ((x2 - x4) * dy - (y2 - y4) * dx);
|
||||
float d3 = ((x3 - x4) * dy - (y3 - y4) * dx);
|
||||
d2 = (d2 >= 0) ? d2 : -d2;
|
||||
d3 = (d3 >= 0) ? d3 : -d3;
|
||||
if ((d2+d3) * (d2+d3) < tess_tol * (dx*dx + dy*dy))
|
||||
if ((d2+d3) * (d2+d3) < tess_tol * (dx*dx + dy*dy))
|
||||
{
|
||||
path->push_back(ImVec2(x4, y4));
|
||||
}
|
||||
@ -719,8 +719,8 @@ static void PathBezierToCasteljau(ImVector<ImVec2>* path, float x1, float y1, fl
|
||||
float x234 = (x23+x34)*0.5f, y234 = (y23+y34)*0.5f;
|
||||
float x1234 = (x123+x234)*0.5f, y1234 = (y123+y234)*0.5f;
|
||||
|
||||
PathBezierToCasteljau(path, x1,y1, x12,y12, x123,y123, x1234,y1234, tess_tol, level+1);
|
||||
PathBezierToCasteljau(path, x1234,y1234, x234,y234, x34,y34, x4,y4, tess_tol, level+1);
|
||||
PathBezierToCasteljau(path, x1,y1, x12,y12, x123,y123, x1234,y1234, tess_tol, level+1);
|
||||
PathBezierToCasteljau(path, x1234,y1234, x234,y234, x34,y34, x4,y4, tess_tol, level+1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -865,14 +865,14 @@ void ImDrawList::AddCircleFilled(const ImVec2& centre, float radius, ImU32 col,
|
||||
PathFill(col);
|
||||
}
|
||||
|
||||
void ImDrawList::AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments)
|
||||
{
|
||||
void ImDrawList::AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments)
|
||||
{
|
||||
if ((col >> 24) == 0)
|
||||
return;
|
||||
|
||||
PathLineTo(pos0);
|
||||
PathBezierCurveTo(cp0, cp1, pos1, num_segments);
|
||||
PathStroke(col, false, thickness);
|
||||
PathLineTo(pos0);
|
||||
PathBezierCurveTo(cp0, cp1, pos1, num_segments);
|
||||
PathStroke(col, false, thickness);
|
||||
}
|
||||
|
||||
void ImDrawList::AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect)
|
||||
@ -1135,7 +1135,7 @@ static unsigned int stb_decompress_length(unsigned char *input);
|
||||
static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsigned int length);
|
||||
static const char* GetDefaultCompressedFontDataTTFBase85();
|
||||
static unsigned int Decode85Byte(char c) { return c >= '\\' ? c-36 : c-35; }
|
||||
static void Decode85(const unsigned char* src, unsigned char* dst)
|
||||
static void Decode85(const unsigned char* src, unsigned char* dst)
|
||||
{
|
||||
while (*src)
|
||||
{
|
||||
|
@ -707,7 +707,7 @@ namespace ImGui
|
||||
IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, ImGuiAlign align = ImGuiAlign_Default, const ImVec2* clip_min = NULL, const ImVec2* clip_max = NULL);
|
||||
IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f);
|
||||
IMGUI_API void RenderCollapseTriangle(ImVec2 p_min, bool opened, float scale = 1.0f, bool shadow = false);
|
||||
IMGUI_API void RenderCheckMark(ImVec2 pos, ImU32 col);
|
||||
IMGUI_API void RenderCheckMark(ImVec2 pos, ImU32 col);
|
||||
IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL); // Find the optional ## from which we stop displaying text.
|
||||
|
||||
IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_existing_clip_rect = true);
|
||||
|
Loading…
Reference in New Issue
Block a user