@@ -31,7 +31,7 @@ Below is a change-log of API breaking changes only. If you are using one of the
3131When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all implot files.
3232You can read releases logs https://github.com/epezent/implot/releases for more details.
3333
34- - 2023/08/20 (0.17) - ImPlotFlags_NoChild was removed as child windows are no longer needed to capture scroll. You can safely remove this flag if you were using it.
34+ - 2023/08/20 (0.17) - ImPlotFlags_NoChild was removed as child windows are no longer needed to capture scroll. You can safely remove this flag if you were using it.
3535- 2023/06/26 (0.15) - Various build fixes related to updates in Dear ImGui internals.
3636- 2022/11/25 (0.15) - Make PlotText honor ImPlotItemFlags_NoFit.
3737- 2022/06/19 (0.14) - The signature of ColormapScale has changed to accommodate a new ImPlotColormapScaleFlags parameter
@@ -604,10 +604,10 @@ bool ClampLegendRect(ImRect& legend_rect, const ImRect& outer_rect, const ImVec2
604604 if (legend_rect.Max .y > outer_rect_pad.Max .y ) {
605605 legend_rect.Max .y = outer_rect_pad.Max .y ;
606606 clamped = true ;
607- }
607+ }
608608 return clamped;
609609}
610-
610+
611611int LegendSortingComp (const void * _a, const void * _b) {
612612 ImPlotItemGroup* items = GImPlot->SortItems ;
613613 const int a = *(const int *)_a;
@@ -1982,9 +1982,9 @@ bool UpdateInput(ImPlotPlot& plot) {
19821982 if (any_hov && ImHasFlag (IO.KeyMods , gp.InputMap .ZoomMod )) {
19831983
19841984 float zoom_rate = gp.InputMap .ZoomRate ;
1985- if (IO.MouseWheel == 0 .0f )
1986- zoom_rate = 0 ;
1987- else if (IO.MouseWheel > 0 )
1985+ if (IO.MouseWheel == 0 .0f )
1986+ zoom_rate = 0 ;
1987+ else if (IO.MouseWheel > 0 )
19881988 zoom_rate = (-zoom_rate) / (1 .0f + (2 .0f * zoom_rate));
19891989 ImVec2 rect_size = plot.PlotRect .GetSize ();
19901990 float tx = ImRemap (IO.MousePos .x , plot.PlotRect .Min .x , plot.PlotRect .Max .x , 0 .0f , 1 .0f );
@@ -2451,7 +2451,7 @@ bool BeginPlot(const char* title_id, const ImVec2& size, ImPlotFlags flags) {
24512451 ResetCtxForNextPlot (GImPlot);
24522452 return false ;
24532453 }
2454-
2454+
24552455 // setup items (or dont)
24562456 if (gp.CurrentItems == nullptr )
24572457 gp.CurrentItems = &plot.Items ;
@@ -3047,7 +3047,7 @@ void EndPlot() {
30473047 const bool legend_scrollable = ClampLegendRect (legend.RectClamped ,
30483048 legend_out ? plot.FrameRect : plot.PlotRect ,
30493049 legend_out ? gp.Style .PlotPadding : gp.Style .LegendPadding
3050- );
3050+ );
30513051 const ImGuiButtonFlags legend_button_flags = ImGuiButtonFlags_AllowOverlap
30523052 | ImGuiButtonFlags_PressedOnClick
30533053 | ImGuiButtonFlags_PressedOnDoubleClick
@@ -3058,7 +3058,7 @@ void EndPlot() {
30583058 ImGui::KeepAliveID (plot.Items .ID );
30593059 ImGui::ButtonBehavior (legend.RectClamped , plot.Items .ID , &legend.Hovered , &legend.Held , legend_button_flags);
30603060 legend.Hovered = legend.Hovered || (ImGui::IsWindowHovered () && legend.RectClamped .Contains (IO.MousePos ));
3061-
3061+
30623062 if (legend_scrollable) {
30633063 if (legend.Hovered ) {
30643064 ImGui::SetKeyOwner (ImGuiKey_MouseWheelY, plot.Items .ID );
@@ -3069,10 +3069,10 @@ void EndPlot() {
30693069 legend.Scroll .x += scroll_step * IO.MouseWheel ;
30703070 legend.Scroll .y += scroll_step * IO.MouseWheel ;
30713071 }
3072- }
3072+ }
30733073 const ImVec2 min_scroll_offset = legend.RectClamped .GetSize () - legend.Rect .GetSize ();
30743074 legend.Scroll .x = ImClamp (legend.Scroll .x , min_scroll_offset.x , 0 .0f );
3075- legend.Scroll .y = ImClamp (legend.Scroll .y , min_scroll_offset.y , 0 .0f );
3075+ legend.Scroll .y = ImClamp (legend.Scroll .y , min_scroll_offset.y , 0 .0f );
30763076 const ImVec2 scroll_offset = legend_horz ? ImVec2 (legend.Scroll .x , 0 ) : ImVec2 (0 , legend.Scroll .y );
30773077 ImVec2 legend_offset = legend.RectClamped .Min - legend.Rect .Min + scroll_offset;
30783078 legend.Rect .Min += legend_offset;
@@ -3082,18 +3082,18 @@ void EndPlot() {
30823082 }
30833083
30843084 const ImU32 col_bg = GetStyleColorU32 (ImPlotCol_LegendBg);
3085- const ImU32 col_bd = GetStyleColorU32 (ImPlotCol_LegendBorder);
3086- ImGui::PushClipRect (legend.RectClamped .Min , legend.RectClamped .Max , true );
3087- DrawList.AddRectFilled (legend.RectClamped .Min , legend.RectClamped .Max , col_bg);
3085+ const ImU32 col_bd = GetStyleColorU32 (ImPlotCol_LegendBorder);
3086+ ImGui::PushClipRect (legend.RectClamped .Min , legend.RectClamped .Max , true );
3087+ DrawList.AddRectFilled (legend.RectClamped .Min , legend.RectClamped .Max , col_bg);
30883088 bool legend_contextable = ShowLegendEntries (plot.Items , legend.Rect , legend.Hovered , gp.Style .LegendInnerPadding , gp.Style .LegendSpacing , !legend_horz, DrawList)
3089- && !ImHasFlag (legend.Flags , ImPlotLegendFlags_NoMenus);
3089+ && !ImHasFlag (legend.Flags , ImPlotLegendFlags_NoMenus);
30903090 DrawList.AddRect (legend.RectClamped .Min , legend.RectClamped .Max , col_bd);
30913091 ImGui::PopClipRect ();
30923092
30933093 // main ctx menu
30943094 if (gp.OpenContextThisFrame && legend_contextable && !ImHasFlag (plot.Flags , ImPlotFlags_NoMenus))
3095- ImGui::OpenPopup (" ##LegendContext" );
3096-
3095+ ImGui::OpenPopup (" ##LegendContext" );
3096+
30973097 if (ImGui::BeginPopup (" ##LegendContext" )) {
30983098 ImGui::Text (" Legend" ); ImGui::Separator ();
30993099 if (ShowLegendContextMenu (legend, !ImHasFlag (plot.Flags , ImPlotFlags_NoLegend)))
@@ -3566,7 +3566,7 @@ void EndSubplots() {
35663566 const ImVec2 legend_pos = GetLocationPos (subplot.FrameRect , legend_size, legend.Location , gp.Style .PlotPadding );
35673567 legend.Rect = ImRect (legend_pos, legend_pos + legend_size);
35683568 legend.RectClamped = legend.Rect ;
3569- const bool legend_scrollable = ClampLegendRect (legend.RectClamped ,subplot.FrameRect , gp.Style .PlotPadding );
3569+ const bool legend_scrollable = ClampLegendRect (legend.RectClamped ,subplot.FrameRect , gp.Style .PlotPadding );
35703570 const ImGuiButtonFlags legend_button_flags = ImGuiButtonFlags_AllowOverlap
35713571 | ImGuiButtonFlags_PressedOnClick
35723572 | ImGuiButtonFlags_PressedOnDoubleClick
@@ -3577,7 +3577,7 @@ void EndSubplots() {
35773577 ImGui::KeepAliveID (subplot.Items .ID );
35783578 ImGui::ButtonBehavior (legend.RectClamped , subplot.Items .ID , &legend.Hovered , &legend.Held , legend_button_flags);
35793579 legend.Hovered = legend.Hovered || (subplot.FrameHovered && legend.RectClamped .Contains (ImGui::GetIO ().MousePos ));
3580-
3580+
35813581 if (legend_scrollable) {
35823582 if (legend.Hovered ) {
35833583 ImGui::SetKeyOwner (ImGuiKey_MouseWheelY, subplot.Items .ID );
@@ -3588,10 +3588,10 @@ void EndSubplots() {
35883588 legend.Scroll .x += scroll_step * IO.MouseWheel ;
35893589 legend.Scroll .y += scroll_step * IO.MouseWheel ;
35903590 }
3591- }
3591+ }
35923592 const ImVec2 min_scroll_offset = legend.RectClamped .GetSize () - legend.Rect .GetSize ();
35933593 legend.Scroll .x = ImClamp (legend.Scroll .x , min_scroll_offset.x , 0 .0f );
3594- legend.Scroll .y = ImClamp (legend.Scroll .y , min_scroll_offset.y , 0 .0f );
3594+ legend.Scroll .y = ImClamp (legend.Scroll .y , min_scroll_offset.y , 0 .0f );
35953595 const ImVec2 scroll_offset = legend_horz ? ImVec2 (legend.Scroll .x , 0 ) : ImVec2 (0 , legend.Scroll .y );
35963596 ImVec2 legend_offset = legend.RectClamped .Min - legend.Rect .Min + scroll_offset;
35973597 legend.Rect .Min += legend_offset;
@@ -3602,13 +3602,13 @@ void EndSubplots() {
36023602
36033603 const ImU32 col_bg = GetStyleColorU32 (ImPlotCol_LegendBg);
36043604 const ImU32 col_bd = GetStyleColorU32 (ImPlotCol_LegendBorder);
3605- ImGui::PushClipRect (legend.RectClamped .Min , legend.RectClamped .Max , true );
3606- DrawList.AddRectFilled (legend.RectClamped .Min , legend.RectClamped .Max , col_bg);
3605+ ImGui::PushClipRect (legend.RectClamped .Min , legend.RectClamped .Max , true );
3606+ DrawList.AddRectFilled (legend.RectClamped .Min , legend.RectClamped .Max , col_bg);
36073607 bool legend_contextable = ShowLegendEntries (subplot.Items , legend.Rect , legend.Hovered , gp.Style .LegendInnerPadding , gp.Style .LegendSpacing , !legend_horz, DrawList)
36083608 && !ImHasFlag (legend.Flags , ImPlotLegendFlags_NoMenus);
36093609 DrawList.AddRect (legend.RectClamped .Min , legend.RectClamped .Max , col_bd);
36103610 ImGui::PopClipRect ();
3611-
3611+
36123612 if (legend_contextable && !ImHasFlag (subplot.Flags , ImPlotSubplotFlags_NoMenus) && ImGui::GetIO ().MouseReleased [gp.InputMap .Menu ])
36133613 ImGui::OpenPopup (" ##LegendContext" );
36143614 if (ImGui::BeginPopup (" ##LegendContext" )) {
0 commit comments