@@ -133,6 +133,11 @@ You can read releases logs https://github.com/epezent/implot/releases for more d
133
133
#define ImDrawFlags_RoundCornersAll ImDrawCornerFlags_All
134
134
#endif
135
135
136
+ // Support for pre-1.89.7 versions.
137
+ #if (IMGUI_VERSION_NUM < 18966)
138
+ #define ImGuiButtonFlags_AllowOverlap ImGuiButtonFlags_AllowItemOverlap
139
+ #endif
140
+
136
141
// Visual Studio warnings
137
142
#ifdef _MSC_VER
138
143
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
@@ -1808,7 +1813,7 @@ bool UpdateInput(ImPlotPlot& plot) {
1808
1813
1809
1814
// BUTTON STATE -----------------------------------------------------------
1810
1815
1811
- const ImGuiButtonFlags plot_button_flags = ImGuiButtonFlags_AllowItemOverlap
1816
+ const ImGuiButtonFlags plot_button_flags = ImGuiButtonFlags_AllowOverlap
1812
1817
| ImGuiButtonFlags_PressedOnClick
1813
1818
| ImGuiButtonFlags_PressedOnDoubleClick
1814
1819
| ImGuiButtonFlags_MouseButtonLeft
@@ -1818,7 +1823,9 @@ bool UpdateInput(ImPlotPlot& plot) {
1818
1823
| plot_button_flags;
1819
1824
1820
1825
const bool plot_clicked = ImGui::ButtonBehavior (plot.PlotRect ,plot.ID ,&plot.Hovered ,&plot.Held ,plot_button_flags);
1821
- ImGui::SetItemAllowOverlap ();
1826
+ #if (IMGUI_VERSION_NUM < 18966)
1827
+ ImGui::SetItemAllowOverlap (); // Handled by ButtonBehavior()
1828
+ #endif
1822
1829
1823
1830
if (plot_clicked) {
1824
1831
if (!ImHasFlag (plot.Flags , ImPlotFlags_NoBoxSelect) && IO.MouseClicked [gp.InputMap .Select ] && ImHasFlag (IO.KeyMods , gp.InputMap .SelectMod )) {
0 commit comments