summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-03-16 08:53:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-03-16 08:53:22 (GMT)
commit223c3162bacd3cf2d41b620882bc6f1536555810 (patch)
treeccedfb520919d247b11580f919f82b443a6ab6c6
parent6115e76eb489dc7c51373fa8dd4b473f0d6dc66b (diff)
downloadtk-223c3162bacd3cf2d41b620882bc6f1536555810.zip
tk-223c3162bacd3cf2d41b620882bc6f1536555810.tar.gz
tk-223c3162bacd3cf2d41b620882bc6f1536555810.tar.bz2
Make WHEEL_DELAY 1.5 s not 1.5 ms. Fix indenting
-rw-r--r--macosx/tkMacOSXMouseEvent.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 93bb704..860bf20 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -333,7 +333,7 @@ enum {
xEvent.xany.window = Tk_WindowId(target);
#define WHEEL_DELTA 120
-#define WHEEL_DELAY 1500000
+#define WHEEL_DELAY 1500000000
uint64_t wheelTick = clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW);
if (wheelTick - tsdPtr->wheelTickPrev >= WHEEL_DELAY) {
tsdPtr->vWheelAcc = tsdPtr->hWheelAcc = 0;
@@ -345,7 +345,7 @@ enum {
if (fabs(tsdPtr->vWheelAcc) >= 1.0) {
xEvent.xbutton.state = state;
xEvent.xkey.keycode = WHEEL_DELTA * ((delta > 0) ? ceil(delta) : floor(delta));
- tsdPtr->vWheelAcc -= (int)xEvent.xkey.keycode / WHEEL_DELTA;
+ tsdPtr->vWheelAcc -= (int)xEvent.xkey.keycode / WHEEL_DELTA;
xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
}
@@ -356,7 +356,7 @@ enum {
if (fabs(tsdPtr->hWheelAcc) >= 1.0) {
xEvent.xbutton.state = state | ShiftMask;
xEvent.xkey.keycode = WHEEL_DELTA * ((delta > 0) ? ceil(delta) : floor(delta));
- tsdPtr->hWheelAcc -= (int)xEvent.xkey.keycode / WHEEL_DELTA;
+ tsdPtr->hWheelAcc -= (int)xEvent.xkey.keycode / WHEEL_DELTA;
xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin));
Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
}