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

When drawing in landscape mode, the saved output saves a square 250x250 image. #2

Open
FinSlate opened this issue May 7, 2020 · 1 comment

Comments

@FinSlate
Copy link

FinSlate commented May 7, 2020

Steps to reproduce.

  • React Native .62
  • Android 10, Nexus 5x API 29 Android Studio Emulator
  1. Adjust virtual phone to landscape format.
  2. Draw Image that takes the whole width of the phone.
  3. Save the image.
  4. Open the image. (I went to Android Studio -> View -> Tool Windows -> Device File Explorer

Expected:

  • Image is the size and resolution that was saved.

Actual:

  • Image is saved as 250x250 square image with left and right edges cut off.

I am trying to look in to the optional parameters we can pass to dispatchViewManagerCommand and the 'DrawView' native Android component.

Thanks.

BeforeSave
aftersave

@FinSlate
Copy link
Author

FinSlate commented May 8, 2020

For anyone wondering- this is very similar to this repo

https://github.com/terrylinla/react-native-sketch-canvas

The other repo handles layouts better on Android. However, this one allows you to save files to the androids internal app directory so you don't need permissions..depends on your use case.

To switch Terry's over you need to go into the Android/src/sketch.java and change the Save path from external to mContext.GetDir() in both instances.

Hopes this helps someone.

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