viking-gps / viking

Viking is a free/open source program to manage GPS data (inc GPX, FIT, TCX and KML files). You can import and plot tracks, routes and waypoints, show OpenStreetMaps (OSM), Bing Aerial and other maps, generate Mapnik maps, geotag images, make new tracks, routes and waypoints, see real-time GPS position, etc. It is written mostly in C with GTK
http://sourceforge.net/projects/viking/
GNU General Public License v2.0
229 stars 56 forks source link

Pinch un/zooming not as smooth as other programs on Chromebook #216

Open jidanni opened 11 months ago

jidanni commented 11 months ago

Today on a Chromebook, I compared the super smooth pinch zooming/unzooming of https://en.wikipedia.org/wiki/Antler,_North_Dakota#/media/File:742d_Missile_Squadron_-_ALL.png with doing the same action on Viking.

It would be great if Viking could be made as smooth as that. Or as smooth as Google Earth zooming.

rnorris commented 11 months ago

I think, since Viking does not have fractional zooming, using pinch zooming seems susceptible to the sensitivity of the hardware gestures and/or however the low level events get passed on to Viking by GTK, resulting in either too little or too large zoom changes especially noticeable due to the whole number jump(s) in zoom levels.

Thus there is a bespoke fudge factor - basically a work around - since I not knowingly otherwise have a way to solve it - that can be applied in an effort to make it seem smoother for any particular system.

See Miscellaneous Settings in the Help Guide and especially try setting (and adjusting) the window_pinch_gesture_factor value in your viking.ini file

jidanni commented 11 months ago

OK, setting window_pinch_gesture_factor=2 seemed to help the most... However, even trying

Select Tool Double Click to Zoom A setting to enable the Select Tool double click behaviour as per the previous default tool (Pan Tool) behaviour. By default this is off, as typically one would use the scroll wheel to zoom. When off this means Viking does not need to wait to see if double clicks are going to occur and so can take immediate action (e.g. show a context menu without delay). Turning this on my be useful for touchpads (however the intention is to support Pinch Zoom behaviour) or perhaps if your scroll wheel is broken.

(my => may)

both on and off didn't help fix the fact that at least on chromebook, Viking treats unpinches as a combination of pans and zooms, when they should only be treated as zooms. Thus the user has to constantly recenter while unpinching to zoom.

Update 2024/4: the discussion that later ensued is over my head so I'll kind of fade out here.

rnorris commented 7 months ago

249 Has recently been applied which may help this issue regarding smoothness.

I'll have to investigate the unpinching behaviour - I do have a laptop with a trackpad - but I don't tend to use the trackpad myself unless my (wireless) mouse has run out of power!

rnorris commented 7 months ago

"Viking treats unpinches as a combination of pans and zooms"

I think this depends on ones point of view of the reference point on where the zoom should occur.

When these gestures occur, Viking gets the X,Y position of where the gesture occurred - which for a trackpad is where ever the mouse pointer is - and thus the zoom is performed around this point.

However (as one is using trackpad), you may be expecting the zoom to occur on the centre of the viewport - so as the zoom is keeping the mouse pointer at the same position - the viewport centre will change.

So IMO Viking isn't accidentally performing 'pan' action.

I don't know what other similar programs do in this situation; potentially one might be able to detect if the source of the gesture is from a trackpad (rather than say on a touchscreen) and potentially have an advanced option of whether a trackpad gesture should zoom on centre or the mouse pointer. Maybe @yourealwaysbe has an opinion on this.

yourealwaysbe commented 7 months ago

I'm also not sure what other apps do. I do like that Viking zooms around the mouse pointer. Then i can point at what I'm interested in and zoom into it, rather than having to try to centre it and realign every now and then. (I'm always using a track pad.)

Edit: the pinch zoom by track pad on Viking behaves the same to me as the pinch zoom on Firefox.