12 if (ImGui::GetCurrentContext()) {
18 if (ImGui::IsKeyPressed(ImGuiKey_R)) {
26 if (!ImGui::IsMouseDown(0)) {
28 }
else if (hovering && ImGui::IsMouseClicked(0)) {
34 ImGui::GetBackgroundDrawList()->AddCircleFilled(
37 (hovering || point.
dragging) ? 0.6f : 0.3f));
39 ImGui::GetBackgroundDrawList()->AddText(
56 if (ImGui::GetCurrentContext()) {
57 auto dir = (position_b - position_a).Normalize() * point_a.
radius;
58 auto line_a = position_a + dir;
59 auto line_b = position_b - dir;
60 ImGui::GetBackgroundDrawList()->AddLine(
61 {line_a.x, line_a.y}, {line_b.x, line_b.y},
65 return std::make_tuple(position_a, position_b);
Point DrawPlaygroundPoint(PlaygroundPoint &point)
std::tuple< Point, Point > DrawPlaygroundLine(PlaygroundPoint &point_a, PlaygroundPoint &point_b)
std::optional< Point > prev_mouse_pos
constexpr Type GetDistance(const TPoint &p) const