diff options
Diffstat (limited to 'src/ui/touch.c')
-rw-r--r-- | src/ui/touch.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ui/touch.c b/src/ui/touch.c index 136457a5..6201b4b6 100644 --- a/src/ui/touch.c +++ b/src/ui/touch.c | |||
@@ -205,15 +205,15 @@ static void update_TouchState_(void *ptr) { | |||
205 | mulvf_F3(&mom->velocity, momFriction); | 205 | mulvf_F3(&mom->velocity, momFriction); |
206 | addv_F3(&mom->accum, mulf_F3(mom->velocity, stepDurationMs / 1000.0f)); | 206 | addv_F3(&mom->accum, mulf_F3(mom->velocity, stepDurationMs / 1000.0f)); |
207 | } | 207 | } |
208 | const iInt2 points = initF3_I2(mom->accum); | 208 | const iInt2 pixels = initF3_I2(mom->accum); |
209 | if (points.x || points.y) { | 209 | if (pixels.x || pixels.y) { |
210 | subv_F3(&mom->accum, initI2_F3(points)); | 210 | subv_F3(&mom->accum, initI2_F3(pixels)); |
211 | dispatchEvent_Widget(mom->affinity, (SDL_Event *) &(SDL_MouseWheelEvent){ | 211 | dispatchEvent_Widget(mom->affinity, (SDL_Event *) &(SDL_MouseWheelEvent){ |
212 | .type = SDL_MOUSEWHEEL, | 212 | .type = SDL_MOUSEWHEEL, |
213 | .timestamp = nowTime, | 213 | .timestamp = nowTime, |
214 | .which = 0, /* means "precise scrolling" in DocumentWidget */ | 214 | .x = pixels.x, |
215 | .x = points.x, | 215 | .y = pixels.y, |
216 | .y = points.y | 216 | .direction = perPixel_MouseWheelFlag |
217 | }); | 217 | }); |
218 | } | 218 | } |
219 | if (length_F3(mom->velocity) < minSpeed) { | 219 | if (length_F3(mom->velocity) < minSpeed) { |
@@ -405,9 +405,9 @@ iBool processEvent_Touch(const SDL_Event *ev) { | |||
405 | dispatchEvent_Widget(touch->affinity, (SDL_Event *) &(SDL_MouseWheelEvent){ | 405 | dispatchEvent_Widget(touch->affinity, (SDL_Event *) &(SDL_MouseWheelEvent){ |
406 | .type = SDL_MOUSEWHEEL, | 406 | .type = SDL_MOUSEWHEEL, |
407 | .timestamp = SDL_GetTicks(), | 407 | .timestamp = SDL_GetTicks(), |
408 | .which = 0, /* means "precise scrolling" in DocumentWidget */ | ||
409 | .x = pixels.x, | 408 | .x = pixels.x, |
410 | .y = pixels.y, | 409 | .y = pixels.y, |
410 | .direction = perPixel_MouseWheelFlag | ||
411 | }); | 411 | }); |
412 | dispatchMotion_Touch_(zero_F3(), 0); | 412 | dispatchMotion_Touch_(zero_F3(), 0); |
413 | /* TODO: Keep increasing movement if the direction is the same. */ | 413 | /* TODO: Keep increasing movement if the direction is the same. */ |