mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 08:03:21 +02:00
parent
c13cbd5ed2
commit
94eaf75d09
8 changed files with 80 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue