Repository navigation
Expand file tree
/
Copy pathimgui_node_editor_internal.inl
More file actions
58 lines (51 loc) · 1.77 KB
/
Copy pathimgui_node_editor_internal.inl
File metadata and controls
58 lines (51 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//------------------------------------------------------------------------------
// VERSION 0.9.4
//
// LICENSE
// This software is dual-licensed to the public domain and under the following
// license: you are granted a perpetual, irrevocable license to copy, modify,
// publish, and distribute this file as you see fit.
//
// CREDITS
// Written by Michal Cichon
//------------------------------------------------------------------------------
#ifndef __IMGUI_NODE_EDITOR_INTERNAL_INL__
#define __IMGUI_NODE_EDITOR_INTERNAL_INL__
#pragma once
//------------------------------------------------------------------------------
#include "imgui_node_editor_internal.h"
//------------------------------------------------------------------------------
namespace ax {
namespace NodeEditor {
namespace Detail {
//------------------------------------------------------------------------------
// inline ImRect ToRect(const ax::rectf& rect)
//{
// return ImRect(
// to_imvec(rect.top_left()),
// to_imvec(rect.bottom_right())
// );
//}
//
// inline ImRect ToRect(const ax::rect& rect)
//{
// return ImRect(
// to_imvec(rect.top_left()),
// to_imvec(rect.bottom_right())
// );
//}
inline ImRect ImGui_GetItemRect() {
return ImRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax());
}
inline ImVec2 ImGui_GetMouseClickPos(ImGuiMouseButton buttonIndex) {
if (ImGui::IsMouseDown(buttonIndex))
return ImGui::GetIO().MouseClickedPos[buttonIndex];
else
return ImGui::GetMousePos();
}
//------------------------------------------------------------------------------
} // namespace Detail
} // namespace NodeEditor
} // namespace ax
//------------------------------------------------------------------------------
#endif // __IMGUI_NODE_EDITOR_INTERNAL_INL__