Skip to content

Commit 1a84dba

Browse files
ocornutthedmd
authored andcommitted
Editor: Define IMGUI_DEFINE_MATH_OPERATORS before <imgui.h> (#209), thanks @ocornut
1 parent 99ec923 commit 1a84dba

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

docs/CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ v0.9.2 (WIP):
22

33
NEW: Editor: Add offset of hover/select to style (thanks @MultiPain)
44

5+
CHANGE: Editor: Define IMGUI_DEFINE_MATH_OPERATORS before <imgui.h> (#209), thanks @ocornut
6+
57
BUGFIX: Editor: Correctly initialize 'width' for view resize code (thx @gnif)
68

79
BUGFIX: Examples: Handle node deletion before links (#182)

imgui_canvas.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# define IMGUI_DEFINE_MATH_OPERATORS
1+
# ifndef IMGUI_DEFINE_MATH_OPERATORS
2+
# define IMGUI_DEFINE_MATH_OPERATORS
3+
# endif
24
# include "imgui_canvas.h"
35
# include <type_traits>
46

imgui_extra_math.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616

1717
//------------------------------------------------------------------------------
18-
# include <imgui.h>
1918
# ifndef IMGUI_DEFINE_MATH_OPERATORS
2019
# define IMGUI_DEFINE_MATH_OPERATORS
2120
# endif
21+
# include <imgui.h>
2222
# include <imgui_internal.h>
2323

2424

imgui_extra_math.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ inline ImVec2 operator*(const float lhs, const ImVec2& rhs)
3434
return ImVec2(lhs * rhs.x, lhs * rhs.y);
3535
}
3636

37-
inline ImVec2 operator-(const ImVec2& lhs)
37+
inline static ImVec2 operator-(const ImVec2& lhs)
3838
{
3939
return ImVec2(-lhs.x, -lhs.y);
4040
}

imgui_node_editor_internal.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515

1616

1717
//------------------------------------------------------------------------------
18+
# ifndef IMGUI_DEFINE_MATH_OPERATORS
19+
# define IMGUI_DEFINE_MATH_OPERATORS
20+
# endif
1821
# include "imgui_node_editor.h"
1922

2023

2124
//------------------------------------------------------------------------------
2225
# include <imgui.h>
23-
# define IMGUI_DEFINE_MATH_OPERATORS
2426
# include <imgui_internal.h>
2527
# include "imgui_extra_math.h"
2628
# include "imgui_bezier_math.h"

0 commit comments

Comments
 (0)