@@ -978,7 +978,7 @@ bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const I
978978 return pressed;
979979}
980980
981- bool ImGui::Checkbox (const char * label, bool * v, bool show_label )
981+ bool ImGui::Checkbox (const char * label, bool * v)
982982{
983983 ImGuiWindow* window = GetCurrentWindow ();
984984 if (window->SkipItems )
@@ -987,14 +987,7 @@ bool ImGui::Checkbox(const char* label, bool* v, bool show_label)
987987 ImGuiContext& g = *GImGui;
988988 const ImGuiStyle& style = g.Style ;
989989 const ImGuiID id = window->GetID (label);
990-
991- ImVec2 label_size; // LIBCHANGE : made this non const
992-
993- if (show_label)
994- label_size = CalcTextSize (label, NULL , true );
995- else
996- label_size = CalcTextSize (" " , NULL , true );
997-
990+ const ImVec2 label_size = CalcTextSize (label, NULL , true );
998991
999992 const float square_sz = GetFrameHeight ();
1000993 const ImVec2 pos = window->DC .CursorPos ;
@@ -1030,7 +1023,7 @@ bool ImGui::Checkbox(const char* label, bool* v, bool show_label)
10301023
10311024 if (g.LogEnabled )
10321025 LogRenderedText (&total_bb.Min , *v ? " [x]" : " [ ]" );
1033- if (label_size.x > 0 .0f && show_label )
1026+ if (label_size.x > 0 .0f )
10341027 RenderText (ImVec2 (check_bb.Max .x + style.ItemInnerSpacing .x , check_bb.Min .y + style.FramePadding .y ), label);
10351028
10361029 IMGUI_TEST_ENGINE_ITEM_INFO (id, label, window->DC .ItemFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0 ));
@@ -2134,9 +2127,8 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* v, floa
21342127 const char * value_buf_end = value_buf + DataTypeFormatString (value_buf, IM_ARRAYSIZE (value_buf), data_type, v, format);
21352128 RenderTextClipped (frame_bb.Min , frame_bb.Max , value_buf, value_buf_end, NULL , ImVec2 (0 .5f , 0 .5f ));
21362129
2137- // --- LIBCHANGE: Commented this to prevent imgui from displaying drag widget's labels
2138- /* if (label_size.x > 0.0f)
2139- RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);*/
2130+ if (label_size.x > 0 .0f )
2131+ RenderText (ImVec2 (frame_bb.Max .x + style.ItemInnerSpacing .x , frame_bb.Min .y + style.FramePadding .y ), label);
21402132
21412133 IMGUI_TEST_ENGINE_ITEM_INFO (id, label, window->DC .ItemFlags );
21422134 return value_changed;
0 commit comments