mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-20 00:23:22 +02:00
parent
98c006aeae
commit
3ff4c2a053
9 changed files with 37 additions and 5 deletions
|
@ -15,10 +15,10 @@ SModeResult CModeTilt::update(Vector2D pos) {
|
|||
|
||||
// create samples array
|
||||
int max = g_pHyprRenderer->m_pMostHzMonitor->refreshRate / 10; // 100ms worth of history
|
||||
samples.resize(max);
|
||||
samples.resize(max, pos);
|
||||
|
||||
// capture current sample
|
||||
samples[samples_index] = Vector2D{pos};
|
||||
samples[samples_index] = pos;
|
||||
int current = samples_index;
|
||||
samples_index = (samples_index + 1) % max; // increase for next sample
|
||||
int first = samples_index;
|
||||
|
@ -37,3 +37,8 @@ void CModeTilt::warp(Vector2D old, Vector2D pos) {
|
|||
for (auto& sample : samples)
|
||||
sample += delta;
|
||||
}
|
||||
|
||||
void CModeTilt::reset() {
|
||||
samples.clear();
|
||||
samples_index = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue