From d3675116ac19f28259f67c2e2a7ea30a06e52eb9 Mon Sep 17 00:00:00 2001 From: boundlessvoid Date: Thu, 26 Jun 2025 20:12:23 +0200 Subject: [PATCH] animation/beziercurve: add getter for control points (hyprwm/Hyprland#10413) Signed-off-by: boundlessvoid --- include/hyprutils/animation/BezierCurve.hpp | 3 +++ src/animation/BezierCurve.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/hyprutils/animation/BezierCurve.hpp b/include/hyprutils/animation/BezierCurve.hpp index b1647df..89b823b 100644 --- a/include/hyprutils/animation/BezierCurve.hpp +++ b/include/hyprutils/animation/BezierCurve.hpp @@ -20,6 +20,9 @@ namespace Hyprutils { float getXForT(float const& t) const; float getYForPoint(float const& x) const; + /* this INCLUDES the 0,0 and 1,1 points. */ + const std::vector& getControlPoints() const; + private: /* this INCLUDES the 0,0 and 1,1 points. */ std::vector m_vPoints; diff --git a/src/animation/BezierCurve.cpp b/src/animation/BezierCurve.cpp index 850cf3a..5b05d2f 100644 --- a/src/animation/BezierCurve.cpp +++ b/src/animation/BezierCurve.cpp @@ -76,3 +76,7 @@ float CBezierCurve::getYForPoint(float const& x) const { return LOWERPOINT->y + ((UPPERPOINT->y - LOWERPOINT->y) * PERCINDELTA); } + +const std::vector& CBezierCurve::getControlPoints() const { + return m_vPoints; +}