Skip to content
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 "FIT" to MenuPreviewSize #88

Open
mozzius opened this issue Dec 13, 2023 · 0 comments
Open

Add "FIT" to MenuPreviewSize #88

mozzius opened this issue Dec 13, 2023 · 0 comments

Comments

@mozzius
Copy link

mozzius commented Dec 13, 2023

I'm trying to recreate twitter's context menu behaviour for images. Images are usually cropped, and long pressing them grows them to their natural aspect ratio, as large as possible. Here are some examples:

  1. Cropped image before long press. Note how it's basically square

image

  1. Long pressing it grows it to be full height, and half width.

image

  1. Here's an example of a wide, short image:

image

However, previewSize: "STRETCH" seems to just set the preview to the maximum possible size, regardless of the size of the rendered preview.

I can either set the image to maintain it's aspect ratio, like so:

Simulator Screenshot - iPhone 15 - 2023-12-13 at 14 48 18

Or I can set it to fill the area, like so:

Simulator Screenshot - iPhone 15 - 2023-12-13 at 14 47 53

I'd love if I could set the preview area to respect the aspect ratio of the original image (alternatively, I wouldn't mind passing in an "aspectRatio" prop)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant