Fix wrong rotation direction

master
LEdoian 4 years ago
parent a10b443d56
commit a58b7433ba

@ -12,11 +12,12 @@ void test_and_fail(void *ptr, char *msg) {
} }
} }
int ror4 (int x) { int rol4 (int x) {
// Just rotate right by 1 bit // Just rotate left by 1 bit
int num = x & 0xf; int num = x & 0xf;
int lowbit = x & 0x1; int sh = num << 1;
return (num >> 1) | (lowbit << 3); int overflow = (sh & 0x10) >> 4;
return (sh & 0xf) | overflow;
} }
int main (void) { int main (void) {
@ -33,7 +34,7 @@ int main (void) {
Rotation all; Rotation all;
all = XRRRotations(dpy, screen_number, &current); all = XRRRotations(dpy, screen_number, &current);
Rotation new = ror4(current); Rotation new = rol4(current);
Time cfg_ts; Time cfg_ts;
Rotation cfg_rot; Rotation cfg_rot;

Loading…
Cancel
Save