fix: use software cursors for shake

This commit is contained in:
Virt 2024-06-27 18:04:49 +02:00
commit d37d8f6ee4
3 changed files with 29 additions and 10 deletions

View file

@ -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;

View file

@ -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();