mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 16:13:21 +02:00
feat: new shake to find behaviour
This commit is contained in:
parent
eabab33f00
commit
553dc93cc0
6 changed files with 118 additions and 37 deletions
|
@ -1,3 +1,4 @@
|
|||
#include "src/helpers/AnimatedVariable.hpp"
|
||||
#include <hyprutils/math/Vector2D.hpp>
|
||||
#include <vector>
|
||||
|
||||
|
@ -6,9 +7,13 @@
|
|||
#define IPC_SHAKE_END "shakeend"
|
||||
|
||||
using namespace Hyprutils::Math;
|
||||
using namespace std::chrono;
|
||||
|
||||
class CShake {
|
||||
public:
|
||||
CShake();
|
||||
~CShake();
|
||||
|
||||
/* calculates the new zoom factor for the current pos */
|
||||
double update(Vector2D pos);
|
||||
|
||||
|
@ -16,8 +21,9 @@ class CShake {
|
|||
/* tracks whether the current shake has already been announced in the ipc */
|
||||
bool ipc = false;
|
||||
|
||||
/* stores last measured diagonal */
|
||||
float diagonal = 0;
|
||||
bool started = false;
|
||||
CAnimatedVariable<float> zoom;
|
||||
steady_clock::time_point end;
|
||||
|
||||
/* ringbuffer for last samples */
|
||||
std::vector<Vector2D> samples;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue