mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 08:03:21 +02:00
fix: guard against divide by 0 in effects (#68)
This commit is contained in:
parent
e2c32d8108
commit
2e7ea0224d
4 changed files with 6 additions and 4 deletions
|
@ -44,7 +44,7 @@ double CShake::update(Vector2D pos) {
|
|||
|
||||
static auto* const* PIPC = (Hyprlang::INT* const*) getConfig(CONFIG_SHAKE_IPC);
|
||||
|
||||
int max = g_pHyprRenderer->m_pMostHzMonitor->refreshRate; // 1s worth of history
|
||||
int max = std::max(1, (int)(g_pHyprRenderer->m_pMostHzMonitor->refreshRate)); // 1s worth of history, avoiding divide by 0
|
||||
samples.resize(max);
|
||||
samples_distance.resize(max);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue