emulsion icon indicating copy to clipboard operation
emulsion copied to clipboard

Show small images in the center

Open vn971 opened this issue 3 years ago • 8 comments

This way, it'd be impossible to zoom in an image and have it completely disappear on the side, outside of the viewing "window". It is also something that I'd intuitively desire as a user, because it keeps the image perfectly aligned when it's small. Non-center is only desired in case of zooming on big images, because they simply wouldn't fit in the screen otherwise.

Thoughts?

vn971 avatar Mar 01 '21 08:03 vn971

I am assuming you are talking about the fact that the image zoom and location are preserved between images if scaling wasn't set to "fit". If you have a large image where you zoom into one of the corners, then step to the next image which is small, the new image may not be visible on the screen at all.

If this is what you are talking about, this is actually a feature. (At least the part where you preserve the zoom and location.) See: #173. If this is what bothers you, I believe a good solution to this problem would be to somehow indicate on the background, where the image is. So if the image is over the right edge of the window, you would still know that.

If I misunderstood you, please describe the sequence of actions in emulsion that lead you to an undesired state, and what would you expect to happen instead.

ArturKovacs avatar Mar 01 '21 09:03 ArturKovacs

@ArturKovacs I think I like the feature of "keeping zoom when switching between images" as well :+1:

The issue I have is a bit different. Suppose you've opened emulsion/resource/1.png If you "randomly" place your mouse on the screen and start zooming in, the picture will move away from the center, until it fully disappears on some side.

What I would like instead, is to keep the image centered while I'm zooming it and it fits the screen. Only when it no longer fits in the center, I'd allow moving it outside.

WRT integration of "keep zoom" feature, one way I'd see it working is to preserve the position and zoom while you're going thorough images, but "fix" it if a user took an explicit zoom in / zoom out action (if the image is small, it can become centered, or at least made to be fully inside the screen). I understand it's subjective though. What do you think?

vn971 avatar Mar 01 '21 10:03 vn971

One possible generalization of the above comment is to force all of the screen area to be used when you're zooming in. This way, there's no need to "reset" or "fix" zoom/position at all. (The question will then be on what to do when the user attempts to "move" the image.) Thoughts?

vn971 avatar Mar 01 '21 10:03 vn971

E.g. when trying to see this image (current emulsion)

2021 03 01_11:59:54

You'd in fact see this

2021 03 01_12:00:18

vn971 avatar Mar 01 '21 11:03 vn971

What I would like instead, is to keep the image centered while I'm zooming it and it fits the screen. Only when it no longer fits in the center, I'd allow moving it outside.

For example the Windows Photos app works like this and I personally really don't like this behavior because to me this breaks the expectation that I'm in control of where I zoom with the cursor. Furthermore what you describe is almost identical to just pressing F and then starting to zoom with scrolling. So I don't think this would be worth implementing.

ArturKovacs avatar Mar 02 '21 07:03 ArturKovacs

Furthermore what you describe is almost identical to just pressing F and then starting to zoom with scrolling.

Maybe to explain a little bit, pressing F and then scrolling will give a different result because the mouse is likely to be positioned not in the perfect center, and the image will move away anyway after scrolling.

What do you think of enforcing at least the center of the viewing angle to intersect with the image? E.g. so that you see at least a quarter of the image?

vn971 avatar Mar 02 '21 08:03 vn971

What do you think of enforcing at least the center of the viewing angle to intersect with the image?

I don't like that either because of the same reason - it's constraining the user in something that I think the user shouldn't be constrained in.

But you are clearly adamant about this so this behavior could be enabled through the config. And in that case, I believe it would be best to lock the image to the center when it's smaller than the window, and when the image is larger than the window, constrain the image position such that the image always fills the window. This cofiguration option could be a boolean, called force_image_to_center.

I don't have time to implement this, but feel free to make a PR

ArturKovacs avatar Mar 03 '21 18:03 ArturKovacs

What about a configuration option (possibly with a keyboard shortcut to toggle) that, when enabled, ensures that the image can't move out of the screen entirely?

Aloso avatar Mar 05 '21 13:03 Aloso