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