10 if (ImGui::GetCurrentContext()) {
11 impeller::Point mouse_pos(ImGui::GetMousePos().x, ImGui::GetMousePos().y);
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);