diff options
| author | boundlessvoid0 <boundlessvoid0@gmail.com> | 2025-07-16 21:35:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-16 21:35:15 +0200 |
| commit | 409b56f6a367735e7b12889bdfac588f74d160c0 (patch) | |
| tree | f14d09782cd8ecd6cbb19ea6a1ab1cdd187512f6 /src/debug/HyprCtl.cpp | |
| parent | 148718b3bcffaa90cd684df90860fd5bda37907f (diff) | |
hyprctl: make animations print details about bezier curves (#10413) (#10871)
Diffstat (limited to 'src/debug/HyprCtl.cpp')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index eb908e1d..cbc8c641 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -786,7 +786,9 @@ static std::string animationsRequest(eHyprCtlOutputFormat format, std::string re ret += "beziers:\n"; for (auto const& bz : g_pAnimationManager->getAllBeziers()) { - ret += std::format("\n\tname: {}\n", bz.first); + auto& controlPoints = bz.second->getControlPoints(); + ret += std::format("\n\tname: {}\n\t\tX0: {:.2f}\n\t\tY0: {:.2f}\n\t\tX1: {:.2f}\n\t\tY1: {:.2f}", bz.first, controlPoints[1].x, controlPoints[1].y, controlPoints[2].x, + controlPoints[2].y); } } else { // json @@ -811,11 +813,16 @@ static std::string animationsRequest(eHyprCtlOutputFormat format, std::string re ret += ",\n["; for (auto const& bz : g_pAnimationManager->getAllBeziers()) { + auto& controlPoints = bz.second->getControlPoints(); ret += std::format(R"#( {{ - "name": "{}" + "name": "{}", + "X0": {:.2f}, + "Y0": {:.2f}, + "X1": {:.2f}, + "Y1": {:.2f} }},)#", - escapeJSONStrings(bz.first)); + escapeJSONStrings(bz.first), controlPoints[1].x, controlPoints[1].y, controlPoints[2].x, controlPoints[2].y); } trimTrailingComma(ret); |
