feat: add dispatcher to trigger magnification

closes: #51
This commit is contained in:
Virt 2025-01-10 22:06:23 +01:00
commit 94eaf75d09
8 changed files with 80 additions and 2 deletions

View file

@ -110,6 +110,15 @@ double CShake::update(Vector2D pos) {
return this->zoom->value();
}
void CShake::force(std::optional<int> duration, std::optional<float> size) {
static auto* const* PTIMEOUT = (Hyprlang::INT* const*) getConfig(CONFIG_SHAKE_TIMEOUT);
static auto* const* PBASE = (Hyprlang::FLOAT* const*) getConfig(CONFIG_SHAKE_BASE);
started = true;
*this->zoom = size.value_or(**PBASE);
this->end = steady_clock::now() + milliseconds(duration.value_or(**PTIMEOUT));
}
void CShake::warp(Vector2D old, Vector2D pos) {
auto delta = pos - old;