Davejkane / riv

Riv - The Rust Image Viewer
MIT License
99 stars 10 forks source link

Fix pan using half-difference #85

Closed Davejkane closed 5 years ago

Davejkane commented 5 years ago

The solutions was obvious the whole time. This closes #68

Davejkane commented 5 years ago

@gurgalex the zoom out is the same as it was originally before I broke it. I prefer this way. If you now zoom in to a pin prick and zoom all the way out until you can barely see the picture, zooming in again will land you on the same pin prick, and I like that.

You might have a point though. Are you suggesting that when the image is smaller than the screen that it shouldn't be possible to pan?

gurgalex commented 5 years ago

I'm saying that zooming out when at an offset results in an off center zoom out (see screenshot)

  1. Zoom in on an image past 100%
  2. Offset all the way to the left
  3. Zoom out to say 50%

Screenshot from 2019-05-29 00-23-35

gurgalex commented 5 years ago

Yeah, I like the pin-prick zoom mechanic.

I expected zooming in, offsetting, and then zooming out to 50% to have an image like this.

Screenshot from 2019-05-29 00-27-48

gurgalex commented 5 years ago

Hmm, I don't mind the layout after playing with it for a bit.

Let's go with this for now.

gurgalex commented 5 years ago

Though, it still looks weird when zoomed out (I think I'm expecting it to zoom in on the place we were zoomed in on)

Davejkane commented 5 years ago

I mean, it would be possible to make the image centered when zoomed out till the picture is small than screen, while still preserving the offset when you zoom back in. But I had it working like that at one point and it seemed unintuitive.

gurgalex commented 5 years ago

Yeah, this view of zooming in and out makes more sense.