#include <ImGuiLayer.h>
Definition at line 38 of file ImGuiLayer.h.
◆ DragCanvas()
ImGui::DragCanvas::DragCanvas |
( |
const void * |
id, |
|
|
SkPoint |
tl = { 0.0f, 0.0f } , |
|
|
SkPoint |
br = { 1.0f, 1.0f } , |
|
|
float |
aspect = -1.0f |
|
) |
| |
|
inline |
Definition at line 39 of file ImGuiLayer.h.
39 { 0.0f, 0.0f },
SkPoint br = { 1.0f, 1.0f },
40 float aspect = -1.0f)
42 ImGui::PushID(id);
44
45
48
49
50 if (aspect < 0) {
52 }
53
54 float availWidth =
std::max(ImGui::GetContentRegionAvailWidth(), 1.0f);
55 fPos = ImGui::GetCursorScreenPos();
56 fSize = ImVec2(availWidth, availWidth * aspect);
57
63 };
69 };
72 }
bool setPolyToPoly(const SkPoint src[], const SkPoint dst[], int count)
static float max(float r, float g, float b)
◆ ~DragCanvas()
ImGui::DragCanvas::~DragCanvas |
( |
| ) |
|
|
inline |
Definition at line 74 of file ImGuiLayer.h.
74 {
76 ImGui::Spacing();
77 ImGui::PopID();
78 }
◆ dragPoint()
void ImGui::DragCanvas::dragPoint |
( |
SkPoint * |
p, |
|
|
bool |
tooltip = false , |
|
|
ImU32 |
color = 0xFFFFFFFF |
|
) |
| |
|
inline |
Definition at line 84 of file ImGuiLayer.h.
84 {
85
87
88
90 ImGui::SetCursorScreenPos(ImVec2(
center.fX - 5,
center.fY - 5));
91 ImGui::InvisibleButton("", ImVec2(10, 10));
92
93 if (ImGui::IsItemActive() && ImGui::IsMouseDragging(0)) {
94
95 ImGuiIO& io = ImGui::GetIO();
98
99
102 }
103
104 if (tooltip && ImGui::IsItemHovered()) {
105 ImGui::SetTooltip(
"x: %.3f\ny: %.3f",
p->fX,
p->fY);
106 }
107
108 ImGui::PopID();
109
112 }
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
void mapXY(SkScalar x, SkScalar y, SkPoint *result) const
skia_private::STArray< 4, ImVec2, true > fScreenPoints
◆ fillColor()
void ImGui::DragCanvas::fillColor |
( |
ImU32 |
color | ) |
|
|
inline |
◆ fDragging
bool ImGui::DragCanvas::fDragging |
◆ fDrawList
ImDrawList* ImGui::DragCanvas::fDrawList |
◆ fID
int ImGui::DragCanvas::fID |
◆ fLocalToScreen
SkMatrix ImGui::DragCanvas::fLocalToScreen |
◆ fPos
ImVec2 ImGui::DragCanvas::fPos |
◆ fScreenPoints
◆ fScreenToLocal
SkMatrix ImGui::DragCanvas::fScreenToLocal |
◆ fSize
ImVec2 ImGui::DragCanvas::fSize |
The documentation for this struct was generated from the following file: