ImageViewer: Implement a "snap to" zoom mode for Pinch/Spread gestures#9533
ImageViewer: Implement a "snap to" zoom mode for Pinch/Spread gestures#9533NiLuJe wants to merge 0 commit into
Conversation
|
It doesn't feel half bad, so, RFC ;). |
|
It's slightly awkward on large screens because you can do a fairly large snap to pinch, but the inverse is not necessarily true because there's more screen space, so even a fully extended spread (which is awkward) won't necessarily correct for it. |
poire-z
left a comment
There was a problem hiding this comment.
Not really what I had in mind in #9529 (comment) - but why not :)
(What I had in mind would need knowing the distance between fingers at start - and the one at end - which I guess is/was not available and why I couldn't do much initially when I made ImageViewer.)
We do know that (it's not exported, but we have the info). But I'm not quite getting what you meant, though. Or did you mean applying a zoom factor that would match the ratio between the span between the starting position of the fingers and the span between the ending position of the fingers? (because, again, that would probably very much match what we do with distance already). |
Yes. I think that's it. |
Eh, I'll try. It feels like it should behave relatively closely to what we do with distance, but who knows ;o). |
|
(But that's my naive expectation ;) i'm happy with what we have since some days ago - and it's quite possible doing it according to this naive expectation will feel more bothering.) |
|
Yeah, tried it, it didn't work out ;p. (It lead to large jumps, which makes sense, pinched fingers make for a very small rectangle, so the ratio is bound to be high). |
|
Made it configurable to see if it actually makes that much difference ;o). (It would appear that: not so much on the H2O ^^). |
|
I'll do more tests tomorrow, but, yeah, probably not worth bothering about, after all ^^. (Was a fun experiment, though). I'll probably do a different PR w/ just the code cleanups, and archive the code in a branch. |
|
Tested this PR with its state as this time, and may be I messed my patching, but it feels quite strange and buggy:
That was with the default new setting checked and untouched (didn't try unchecked). |
I got this with some SVG image (the first on in my SVG test suite EPUB) - so it's possible this affects only SVG, which get their scale_factor handled a bit specifically (image_wg always getting scale_factor=1). |
|
Yeah, agree that it's usually close enough to the current behavior when it works, and when it doesn't, it's actively irritating ^^. |
|
Superseded by #9544 |
And use it, for pinches, when the image is smaller than the screen, and for spreads, when we spread outside of the image's bounds (more or less).
Followup to #9529 ;).
Also, document an unfortunate quirk of the distance field for two_finger_pan/swipe, which requires ugliness in our existing handlers for it; and minor code cleanups.
This change is