mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 16:13:21 +02:00
fix: use software cursors for shake
This commit is contained in:
parent
cde5bf84fb
commit
d37d8f6ee4
3 changed files with 29 additions and 10 deletions
|
@ -254,11 +254,26 @@ void CDynamicCursors::calculate() {
|
|||
else if (strcmp(*PMODE, "none")) // if not none, print warning
|
||||
Debug::log(WARN, "[dynamic-cursors] unknown mode specified");
|
||||
|
||||
if (zoom > 1 && !**PSHAKE_EFFECTS)
|
||||
angle = 0;
|
||||
if (zoom > 1) {
|
||||
if (!**PSHAKE_EFFECTS) angle = 0;
|
||||
|
||||
if (!software) {
|
||||
g_pPointerManager->lockSoftwareAll();
|
||||
software = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (software) {
|
||||
// damage so it is cleared
|
||||
g_pPointerManager->damageIfSoftware();
|
||||
|
||||
g_pPointerManager->unlockSoftwareAll();
|
||||
software = false;
|
||||
}
|
||||
}
|
||||
|
||||
// we only consider the angle changed if it is larger than 1 degree
|
||||
if (abs(this->angle - angle) > ((PI / 180) * **PTHRESHOLD) || abs(this->zoom - zoom) > 0.1) {
|
||||
if (abs(this->angle - angle) > ((PI / 180) * **PTHRESHOLD) || abs(this->zoom - zoom) > 0.1 || (zoom == 1 && this->zoom != 1)) {
|
||||
this->angle = angle;
|
||||
this->zoom = zoom;
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ class CDynamicCursors {
|
|||
double angle;
|
||||
// current zoom value of the cursor
|
||||
double zoom = 1;
|
||||
// whether we have already locked software
|
||||
bool software = false;
|
||||
|
||||
// calculates the current angle of the cursor, and changes the cursor shape
|
||||
void calculate();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue