Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Two finger panning is slow #7849

Merged
merged 8 commits into from May 19, 2024
Merged

Conversation

zsviczian
Copy link
Collaborator

@zsviczian zsviczian commented Apr 4, 2024

fix #2497
fix #6913

With this change, two finger panning on iPad matches the single finger panning with the hand tool. I tested this with various zoom levels.

sorry - can't figure out how to update tests to accommodate the change :(

Copy link

vercel bot commented Apr 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
excalidraw ✅ Ready (Inspect) Visit Preview May 19, 2024 0:13am
excalidraw-package-example ✅ Ready (Inspect) Visit Preview May 19, 2024 0:13am
excalidraw-package-example-with-nextjs ✅ Ready (Inspect) Visit Preview May 19, 2024 0:13am
1 Ignored Deployment
Name Status Preview Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview May 19, 2024 0:13am

Copy link

github-actions bot commented May 19, 2024

Coverage Report

Status Category Percentage Covered / Total
🔴 Lines 65.54% (🎯 70%) 51228 / 78158
🔴 Statements 65.54% (🎯 70%) 51228 / 78158
🔴 Functions 66.55% (🎯 68%) 1562 / 2347
🟢 Branches 80.97% (🎯 70%) 6287 / 7764
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/excalidraw/components/App.tsx 69.48% 76.47% 67.87% 69.48% 474-475, 582-591, 690-691, 709-710, 731-791, 794-800, 803-806, 809-885, 888-907, 910-915, 923-933, 935-936, 941-942, 946-948, 962, 969-1230, 1290-1291, 1302-1303, 1331-1333, 1343-1388, 1414, 1424, 1431-1434, 1443-1447, 1478-1479, 1563-1573, 1578-1593, 1597-1644, 1716-1721, 1750-1755, 1758-1788, 1796-1821, 1824-1833, 1836-1948, 1951-1959, 1968-1981, 1984-2010, 2013-2084, 2087-2128, 2180-2181, 2195-2196, 2223-2224, 2228-2229, 2249-2257, 2262-2275, 2281-2282, 2287-2295, 2297-2305, 2317, 2358-2359, 2381-2382, 2389, 2458-2460, 2463-2468, 2473-2474, 2513-2521, 2526-2535, 2573-2574, 2658-2659, 2663, 2666-2667, 2675-2678, 2687-2700, 2706-2709, 2712, 2714-2715, 2722-2723, 2729-2730, 2733-2734, 2742-2743, 2746-2747, 2750-2753, 2764-2772, 2777-2778, 2828-2829, 2843-2849, 2855-2863, 2867-2875, 2879-2880, 2883-2916, 2919-2931, 2942-2943, 2954-2955, 2972-2976, 2980-2983, 2990-2992, 3010-3017, 3020, 3022-3027, 3031-3033, 3054-3055, 3062-3064, 3066-3089, 3115, 3121, 3177-3178, 3195-3197, 3219-3220, 3226-3229, 3235-3316, 3388-3389, 3448, 3458-3476, 3479-3485, 3488-3489, 3495-3508, 3594-3595, 3597-3598, 3603-3605, 3613-3614, 3637-3651, 3656-3675, 3727-3728, 3800, 3809-3810, 3812-3819, 3834-3838, 3849-3850, 3853-3857, 3859-3860, 3862-3865, 3890-3891, 3900-3902, 3904, 3987-3990, 4012-4014, 4024-4025, 4027-4047, 4050-4056, 4073-4076, 4082-4085, 4095-4102, 4142-4146, 4150, 4155-4156, 4161-4165, 4198-4199, 4202-4203, 4206-4207, 4215-4219, 4224-4225, 4231-4241, 4246-4273, 4278-4289, 4353, 4379-4380, 4445-4451, 4534, 4559, 4585-4587, 4654-4655, 4670-4671, 4841-4842, 4845-4846, 4854, 4903-4907, 4958-4965, 4971-5037, 5081, 5133, 5160, 5167-5168, 5177-5180, 5211, 5259-5262, 5265-5271, 5273-5276, 5291-5300, 5303-5304, 5404-5405, 5408, 5410-5415, 5421-5423, 5425, 5434, 5456-5461, 5463-5466, 5470-5471, 5481-5581, 5585-5586, 5601-5602, 5635-5636, 5663-5664, 5697-5724, 5731-5732, 5754-5755, 5774, 5776-5819, 5824-5825, 5827-5828, 5844-5845, 5851-5852, 5856-5859, 5862-5863, 5878-5905, 5913-5914, 5918-5921, 5923-5927, 5945-5949, 5995-6000, 6002-6004, 6020, 6022-6035, 6060-6063, 6107, 6124-6125, 6127-6150, 6165-6166, 6277-6305, 6411-6412, 6432-6433, 6527, 6533-6534, 6557-6576, 6591, 6719, 6741-6779, 6783-6833, 6848, 6857, 6891-6897, 6912-6914, 7056-7059, 7083-7114, 7127, 7129-7137, 7151, 7153-7161, 7168-7171, 7179-7184, 7211-7212, 7217-7219, 7222-7223, 7248-7249, 7280-7281, 7364-7365, 7414-7427, 7493-7496, 7522-7523, 7559-7560, 7573, 7591-7597, 7604-7607, 7630-7636, 7708, 7714, 7729-7736, 7739-7746, 7802, 7879-7880, 7901-7903, 7906, 7920-7944, 8050-8074, 8084-8123, 8136-8137, 8146-8153, 8167-8180, 8193-8200, 8254-8280, 8282-8283, 8357-8358, 8365, 8367-8403, 8432, 8493, 8525-8527, 8552-8557, 8559-8560, 8565-8567, 8570-8590, 8604-8605, 8611-8620, 8625, 8629-8633, 8642-8646, 8649-8654, 8658-8665, 8695, 8697-8701, 8703-8713, 8729-8731, 8742-8750, 8754-8798, 8801-8872, 8880, 8898-8905, 8907-8923, 8938-8960, 8979-8981, 9026-9027, 9141-9145, 9147-9163, 9165-9169, 9181-9182, 9192-9208, 9227-9246, 9248-9249, 9276-9277, 9281-9282, 9292, 9294-9297, 9299-9300, 9340, 9361-9362, 9388, 9391, 9432, 9444-9452, 9469-9470, 9502-9505, 9598-9605, 9631-9632, 9675-9729, 9777-9778, 9787-9790, 9795-9796, 9817-9819, 9821-9825, 9863
Generated in workflow #2531

Comment on lines +5100 to +5101
scrollX: zoomState.scrollX + 2 * (deltaX / nextZoom),
scrollY: zoomState.scrollY + 2 * (deltaY / nextZoom),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 2x? Isn't this more related to devicePixelRatio which on most mobile touchscreens would coincide with 2?

@zsviczian
Copy link
Collaborator Author

All I can confirm is I deployed this change 6 weeks ago to Obsidian and since then I had received no complains. It works well for me on iPad and Android. Finally panning is as quick as with a mouse.

@dwelle
Copy link
Member

dwelle commented May 19, 2024

Yeah, I was just wondering if there was a reasoning behind it, or it's just a magic number. I'll add a comment it's a magic number then. :)

@dwelle
Copy link
Member

dwelle commented May 19, 2024

Thanks Zsolt! ❤️

@dwelle dwelle merged commit be4e127 into master May 19, 2024
11 checks passed
@dwelle dwelle deleted the zsviczian-fix-twofinger-panning branch May 19, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

finger coordinates when navigating do not match my expected view Firefox scrolling is slow
2 participants