Skip to content

Commit 0042397

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

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
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_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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ inline ImVec2 operator*(const float lhs, const ImVec2& rhs)
3434
return ImVec2(lhs * rhs.x, lhs * rhs.y);
3535
}
3636

37+
#ifndef IMGUI_DEFINE_MATH_OPERATORS
3738
inline ImVec2 operator-(const ImVec2& lhs)
3839
{
3940
return ImVec2(-lhs.x, -lhs.y);
4041
}
42+
#endif
4143

4244

4345
//------------------------------------------------------------------------------

imgui_node_editor_internal.h

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

1616

1717
//------------------------------------------------------------------------------
18+
# define IMGUI_DEFINE_MATH_OPERATORS
1819
# include "imgui_node_editor.h"
1920

2021

2122
//------------------------------------------------------------------------------
2223
# include <imgui.h>
23-
# define IMGUI_DEFINE_MATH_OPERATORS
2424
# include <imgui_internal.h>
2525
# include "imgui_extra_math.h"
2626
# include "imgui_bezier_math.h"

0 commit comments

Comments
 (0)