-
Notifications
You must be signed in to change notification settings - Fork 536
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
[BUG] Custom scale value is overridden by rescale logic during initial widget layout, not able to apply 4 custom parameters during initial image rendering #289
Comments
@renancaraujo I've cloned your repo and tried to force the flag |
Due to the interaction between the two controllers (scale state controller and the main one) we have this scaling on the mount phase. What you want is different than This is a core problem with the controller. Apparent solution: we have to add a scale to be passed via the controller constructor. |
Could you test this branch if it works for you: #322 In this way you pass the starting scale to the controller constructor. |
Adde an initial scale option to #322 |
I guess this is closed now? |
Dear @renancaraujo, I am so sorry that I've missed this reply from you. Thank you for all your work and great library. I am going to implement supported initial scale in upcoming release! :) |
Describe the bug
The library is awesome and ideally covers my needs. My use case is to remember image rotation, scale, etc. that are done by user. When user opens the same image again, I would like to show the image with previous values. PhotoViewController is an ideal way for this, but my custom scale value is overridden during initial widget layout. Details below
To Reproduce
Configuration 1
I see issue in the following method, where delegate forces recalculation for scale due to markNeedsScaleRecalc flag that is true:
What is the current behavior?
All parameters (rotation, position, rotationFocusPoint) except scale are applied. Scale parameter is overridden due to rescale logic.
Expected behavior
Custom scale value is correctly applied to the image.
Configuration 2
What is the current behavior?
Only scale parameter is applied. Rotation, position, rotationFocusPoint are ignored.
Expected behavior
All 4 parameters are applied correctly.
InitialScale looks suitable for this case, moreover it works correctly. I can see that the image is scaled properly, when I set initial scale, but 3 other parameters (rotation, position, rotationFocusPoint) are not applied correctly via controller setMultiply. In other words, I can apply correct scale using initialScale property or I can correctly apply 3 remaining parameters, but only when I do not specify initialScale.
The only workaround that I have is the following. Apply image parameters after build with some delay, but it is bad solution :(
I am not sure if it is a defect or expected behaviour. If it is expected, please let me know how to supported my use case.
The text was updated successfully, but these errors were encountered: