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
Add ability to zoom in/out on all images #38538
Conversation
Is there an issue for this? |
Yes, but it was recently closed: #18987 |
@bschlenk this is pretty cool now. some thoughts:
|
Is there an easy way to grab settings from within resourceViewer.ts? There are some settings I thought would be nice to have:
|
Yes, it seems t happen for any image smaller 256px, e.g. see this: Compared to (in stable):
No, not at the layer of the resource viewer. I do not think putting it in a cache in there would be an issue.
It would be nice to do this within the resource viewer to not break layers. We can enrich the resource viewers method to return an object that we can call layout on and then just call
Or right click maybe? Is there an example of how other tools are doing it?
Not sure I would want settings for this. After all we are not an editor for images, so we should have a good out of the box experience. |
I'm not sure why your screenshot would look pixelated, according to MDN image-rendering has no effect on non-scaled images. I could reduce the threshold to 56px, but I have some images larger than that which should display pixelated. Is it easy to add a right click menu? A pixelated/non-pixelated option could be added there. Photoshop uses cmd + 1 to zoom 100%, but that's already used to change editor windows. Gimp uses shift + ctrl + E, but that feels convoluted. This seems like another candidate for a right click menu. But if that's not an option, then I think right click makes sense as the return to 100% function. |
If it helps, I have an external monitor connected to my MacBook Pro with a resolution of |
Yeah I think it makes sense once you are zooming in at least. |
Images are now always centered in the window. They initially start at their native size, unless they would be larger than the window, in which case they are contained within the window. Clicking increases the zoom, and alt+click decreases it. Pinch to zoom and ctrl+scroll are also supported.
ResourceViewer now holds a cache of image scales so they stay the same while flipping between editor tabs. Right clicking now returns the image to its original scale. Pixelation only triggers for images 64x64 or smaller, and only after the first zoom. Editor risizing is handled thorugh the layout call to the binary editor, passed down to the resource viewer.
@bpasero Any updates on this getting merged? |
@mjbvz you seem to want to own this, so feel free. make sure to add a test plan item and add me as tester. |
Allows smaller images to be scaled up when viewing, either by pinching the trackpad, or holding ctrl while scrolling. Adds image-rendering: pixelated to the css if the image size is below a threshold.