Conversation
|
Please check https://github.com/mozilla/pdf.js/blob/7cfcd00a385314a05e0ff247d80262200a0e1556/web/app.js#L2616-L2618. The magic numbers are really magic and they affect user experience. We may not seek a homemade "pinch-to-zoom" but just follow what pdf.js does. |
|
these code looks far more complicate than current ones. it includes checks for different hardware(touchpad, ctrl+wheel) and different delta mode(line, pixel, page). do you mean we should do similar thing? i think it is too complex for now |
The current ctrl+wheel handling was simplified from that in pdf.js. Following what it does, we didn't accumulate Though pdf.js implements a complicated wheel handler, I think we need to understand that handler before making any changes. |
|
does mouse use line mode? i dont have a mouse at this moment |
|
for now i think we can simply divide the problem into 2 parts. for pixel ones, we accumulate scroll distance and only trigger 1 scale event. for line ones, we can reuse the original logic |
I don't have one either. 😿 😸 |
there are two parts in the wheel handler of pdf.js. the first one is for smooth zooming with a touchpad like device, and we are on the second part. We may just replicate the second part for simplicity. |
995e5f3 to
b8af7dc
Compare
b8af7dc to
449d116
Compare
449d116 to
6bb1fa8
Compare
|
I just test this with my mouse and it works the same as before |
fix #238 fix #208
I just randomly choose a threshold, and currently I don't have a mouse. Please test!