|
@@ -1108,28 +1108,24 @@ bool ImGui::ImageButton(const char* str_id, ImTextureID user_texture_id, const I
|
|
|
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
// Legacy API obsoleted in 1.89. Two differences with new ImageButton()
|
|
// Legacy API obsoleted in 1.89. Two differences with new ImageButton()
|
|
-// - new ImageButton() requires an explicit 'const char* str_id' Old ImageButton() used opaque imTextureId (created issue with: multiple buttons with same image, transient texture id values, opaque computation of ID)
|
|
|
|
-// - new ImageButton() always use style.FramePadding Old ImageButton() had an override argument.
|
|
|
|
-// If you need to change padding with new ImageButton() you can use PushStyleVar(ImGuiStyleVar_FramePadding, value), consistent with other Button functions.
|
|
|
|
|
|
+// - old ImageButton() used ImTextureId as item id (created issue with multiple buttons with same image, transient texture id values, opaque computation of ID)
|
|
|
|
+// - new ImageButton() requires an explicit 'const char* str_id'
|
|
|
|
+// - old ImageButton() had frame_padding' override argument.
|
|
|
|
+// - new ImageButton() always use style.FramePadding.
|
|
|
|
+/*
|
|
bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col)
|
|
bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col)
|
|
{
|
|
{
|
|
- ImGuiContext& g = *GImGui;
|
|
|
|
- ImGuiWindow* window = g.CurrentWindow;
|
|
|
|
- if (window->SkipItems)
|
|
|
|
- return false;
|
|
|
|
-
|
|
|
|
// Default to using texture ID as ID. User can still push string/integer prefixes.
|
|
// Default to using texture ID as ID. User can still push string/integer prefixes.
|
|
PushID((void*)(intptr_t)user_texture_id);
|
|
PushID((void*)(intptr_t)user_texture_id);
|
|
- const ImGuiID id = window->GetID("#image");
|
|
|
|
- PopID();
|
|
|
|
-
|
|
|
|
if (frame_padding >= 0)
|
|
if (frame_padding >= 0)
|
|
PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2((float)frame_padding, (float)frame_padding));
|
|
PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2((float)frame_padding, (float)frame_padding));
|
|
- bool ret = ImageButtonEx(id, user_texture_id, size, uv0, uv1, bg_col, tint_col);
|
|
|
|
|
|
+ bool ret = ImageButton("", user_texture_id, size, uv0, uv1, bg_col, tint_col);
|
|
if (frame_padding >= 0)
|
|
if (frame_padding >= 0)
|
|
PopStyleVar();
|
|
PopStyleVar();
|
|
|
|
+ PopID();
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
+*/
|
|
#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
|
|
|
bool ImGui::Checkbox(const char* label, bool* v)
|
|
bool ImGui::Checkbox(const char* label, bool* v)
|