@@ -31,7 +31,7 @@ Below is a change-log of API breaking changes only. If you are using one of the
31
31
When 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.
32
32
You can read releases logs https://github.com/epezent/implot/releases for more details.
33
33
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.
35
35
- 2023/06/26 (0.15) - Various build fixes related to updates in Dear ImGui internals.
36
36
- 2022/11/25 (0.15) - Make PlotText honor ImPlotItemFlags_NoFit.
37
37
- 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
604
604
if (legend_rect.Max .y > outer_rect_pad.Max .y ) {
605
605
legend_rect.Max .y = outer_rect_pad.Max .y ;
606
606
clamped = true ;
607
- }
607
+ }
608
608
return clamped;
609
609
}
610
-
610
+
611
611
int LegendSortingComp (const void * _a, const void * _b) {
612
612
ImPlotItemGroup* items = GImPlot->SortItems ;
613
613
const int a = *(const int *)_a;
@@ -1982,9 +1982,9 @@ bool UpdateInput(ImPlotPlot& plot) {
1982
1982
if (any_hov && ImHasFlag (IO.KeyMods , gp.InputMap .ZoomMod )) {
1983
1983
1984
1984
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 )
1988
1988
zoom_rate = (-zoom_rate) / (1 .0f + (2 .0f * zoom_rate));
1989
1989
ImVec2 rect_size = plot.PlotRect .GetSize ();
1990
1990
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) {
2451
2451
ResetCtxForNextPlot (GImPlot);
2452
2452
return false ;
2453
2453
}
2454
-
2454
+
2455
2455
// setup items (or dont)
2456
2456
if (gp.CurrentItems == nullptr )
2457
2457
gp.CurrentItems = &plot.Items ;
@@ -3047,7 +3047,7 @@ void EndPlot() {
3047
3047
const bool legend_scrollable = ClampLegendRect (legend.RectClamped ,
3048
3048
legend_out ? plot.FrameRect : plot.PlotRect ,
3049
3049
legend_out ? gp.Style .PlotPadding : gp.Style .LegendPadding
3050
- );
3050
+ );
3051
3051
const ImGuiButtonFlags legend_button_flags = ImGuiButtonFlags_AllowOverlap
3052
3052
| ImGuiButtonFlags_PressedOnClick
3053
3053
| ImGuiButtonFlags_PressedOnDoubleClick
@@ -3058,7 +3058,7 @@ void EndPlot() {
3058
3058
ImGui::KeepAliveID (plot.Items .ID );
3059
3059
ImGui::ButtonBehavior (legend.RectClamped , plot.Items .ID , &legend.Hovered , &legend.Held , legend_button_flags);
3060
3060
legend.Hovered = legend.Hovered || (ImGui::IsWindowHovered () && legend.RectClamped .Contains (IO.MousePos ));
3061
-
3061
+
3062
3062
if (legend_scrollable) {
3063
3063
if (legend.Hovered ) {
3064
3064
ImGui::SetKeyOwner (ImGuiKey_MouseWheelY, plot.Items .ID );
@@ -3069,10 +3069,10 @@ void EndPlot() {
3069
3069
legend.Scroll .x += scroll_step * IO.MouseWheel ;
3070
3070
legend.Scroll .y += scroll_step * IO.MouseWheel ;
3071
3071
}
3072
- }
3072
+ }
3073
3073
const ImVec2 min_scroll_offset = legend.RectClamped .GetSize () - legend.Rect .GetSize ();
3074
3074
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 );
3076
3076
const ImVec2 scroll_offset = legend_horz ? ImVec2 (legend.Scroll .x , 0 ) : ImVec2 (0 , legend.Scroll .y );
3077
3077
ImVec2 legend_offset = legend.RectClamped .Min - legend.Rect .Min + scroll_offset;
3078
3078
legend.Rect .Min += legend_offset;
@@ -3082,18 +3082,18 @@ void EndPlot() {
3082
3082
}
3083
3083
3084
3084
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);
3088
3088
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);
3090
3090
DrawList.AddRect (legend.RectClamped .Min , legend.RectClamped .Max , col_bd);
3091
3091
ImGui::PopClipRect ();
3092
3092
3093
3093
// main ctx menu
3094
3094
if (gp.OpenContextThisFrame && legend_contextable && !ImHasFlag (plot.Flags , ImPlotFlags_NoMenus))
3095
- ImGui::OpenPopup (" ##LegendContext" );
3096
-
3095
+ ImGui::OpenPopup (" ##LegendContext" );
3096
+
3097
3097
if (ImGui::BeginPopup (" ##LegendContext" )) {
3098
3098
ImGui::Text (" Legend" ); ImGui::Separator ();
3099
3099
if (ShowLegendContextMenu (legend, !ImHasFlag (plot.Flags , ImPlotFlags_NoLegend)))
@@ -3566,7 +3566,7 @@ void EndSubplots() {
3566
3566
const ImVec2 legend_pos = GetLocationPos (subplot.FrameRect , legend_size, legend.Location , gp.Style .PlotPadding );
3567
3567
legend.Rect = ImRect (legend_pos, legend_pos + legend_size);
3568
3568
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 );
3570
3570
const ImGuiButtonFlags legend_button_flags = ImGuiButtonFlags_AllowOverlap
3571
3571
| ImGuiButtonFlags_PressedOnClick
3572
3572
| ImGuiButtonFlags_PressedOnDoubleClick
@@ -3577,7 +3577,7 @@ void EndSubplots() {
3577
3577
ImGui::KeepAliveID (subplot.Items .ID );
3578
3578
ImGui::ButtonBehavior (legend.RectClamped , subplot.Items .ID , &legend.Hovered , &legend.Held , legend_button_flags);
3579
3579
legend.Hovered = legend.Hovered || (subplot.FrameHovered && legend.RectClamped .Contains (ImGui::GetIO ().MousePos ));
3580
-
3580
+
3581
3581
if (legend_scrollable) {
3582
3582
if (legend.Hovered ) {
3583
3583
ImGui::SetKeyOwner (ImGuiKey_MouseWheelY, subplot.Items .ID );
@@ -3588,10 +3588,10 @@ void EndSubplots() {
3588
3588
legend.Scroll .x += scroll_step * IO.MouseWheel ;
3589
3589
legend.Scroll .y += scroll_step * IO.MouseWheel ;
3590
3590
}
3591
- }
3591
+ }
3592
3592
const ImVec2 min_scroll_offset = legend.RectClamped .GetSize () - legend.Rect .GetSize ();
3593
3593
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 );
3595
3595
const ImVec2 scroll_offset = legend_horz ? ImVec2 (legend.Scroll .x , 0 ) : ImVec2 (0 , legend.Scroll .y );
3596
3596
ImVec2 legend_offset = legend.RectClamped .Min - legend.Rect .Min + scroll_offset;
3597
3597
legend.Rect .Min += legend_offset;
@@ -3602,13 +3602,13 @@ void EndSubplots() {
3602
3602
3603
3603
const ImU32 col_bg = GetStyleColorU32 (ImPlotCol_LegendBg);
3604
3604
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);
3607
3607
bool legend_contextable = ShowLegendEntries (subplot.Items , legend.Rect , legend.Hovered , gp.Style .LegendInnerPadding , gp.Style .LegendSpacing , !legend_horz, DrawList)
3608
3608
&& !ImHasFlag (legend.Flags , ImPlotLegendFlags_NoMenus);
3609
3609
DrawList.AddRect (legend.RectClamped .Min , legend.RectClamped .Max , col_bd);
3610
3610
ImGui::PopClipRect ();
3611
-
3611
+
3612
3612
if (legend_contextable && !ImHasFlag (subplot.Flags , ImPlotSubplotFlags_NoMenus) && ImGui::GetIO ().MouseReleased [gp.InputMap .Menu ])
3613
3613
ImGui::OpenPopup (" ##LegendContext" );
3614
3614
if (ImGui::BeginPopup (" ##LegendContext" )) {
0 commit comments