Skip to content

Commit 3fb7951

Browse files
committed
imgui compat fixes
1 parent 9bf98fe commit 3fb7951

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/core/imgui-knobs.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ namespace ImGuiKnobs {
3333

3434
auto *draw_list = ImGui::GetWindowDrawList();
3535

36+
#if IMGUI_VERSION_NUM >= 19010
37+
draw_list->AddBezierCubic(start, arc1, arc2, end, color, thickness, num_segments);
38+
#else
3639
draw_list->AddBezierCurve(start, arc1, arc2, end, color, thickness, num_segments);
40+
#endif
3741
}
3842

3943
void draw_arc(ImVec2 center, float radius, float start_angle, float end_angle, float thickness, ImColor color, int num_segments, int bezier_count) {

src/core/imgui_plot.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
*
77
*/
88

9-
#include "imgui_plot.h"
109

1110
#ifndef IMGUI_DEFINE_MATH_OPERATORS
1211
#define IMGUI_DEFINE_MATH_OPERATORS
1312
#endif
13+
14+
#include "imgui_plot.h"
1415
#include "imgui_internal.h"
1516

1617
float imMap(float value, float inputMin, float inputMax, float outputMin, float outputMax, bool clamp){
@@ -108,7 +109,11 @@ PlotStatus Plot(const char* label, const PlotConfig& conf) {
108109
ImGui::ItemSize(total_bb, style.FramePadding.y);
109110
if (!ImGui::ItemAdd(total_bb, 0, &frame_bb))
110111
return status;
112+
#if IMGUI_VERSION_NUM >= 19010
113+
const bool hovered = ImGui::ItemHoverable(frame_bb, id,ImGuiHoveredFlags_None);
114+
#else
111115
const bool hovered = ImGui::ItemHoverable(frame_bb, id);
116+
#endif
112117

113118
ImGui::RenderFrame(
114119
frame_bb.Min,

0 commit comments

Comments
 (0)