-
Notifications
You must be signed in to change notification settings - Fork 101
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
coordinates by reverse use of matrix to get original value #16
Comments
But I notice if I do not enlarge the object on the screen (scale = 1.0) there is no problem. This makes me think I do not understand everything. I use |
Hello, please did you manage to find a solution for this? I am facing the exact same issue |
I will see if I can fine my GitHub account information to sign on to GitHub and go over what was said before.
I did get it to work for what I wanted, and it has worked OK
… On Dec 18, 2022, at 7:07 PM, Venusdjinni ***@***.***> wrote:
Hello, please did you manage to find a solution for this? I am facing the exact same issue
—
Reply to this email directly, view it on GitHub <#16 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABW7LCK3J2GZM52NLFVSMUDWN6KLRANCNFSM4MNWL57A>.
You are receiving this because you authored the thread.
|
I think the comments above are what I did. I do not do any rotation, but I do allow translation and scale, and it works. I think what I was concerned about is that I did not quite understand everything, and so something might not work with a different device. But it has worked OK. Maybe if you can say what you have written and what problems you have? |
I am building an image editor, and what I want is to convert the transformation of a widget into 'real scale' values. I managed to do it accurately when there is no scale or rotation, but whenever I enable one of them, |
I did not do rotation, but I did get scale and offset (Translate/move of origin) to work. Sometimes knowing that something works does allow solving. It is getting a bit late here. |
In my gesture detector I have: //GestureDetector activates 3 'handle' methods below to account for screen void _handleScaleUpdate(ScaleUpdateDetails details) {
} void _handleScaleReset() { @OverRide |
Thank you. I will have a look at it tomorrow, it's pretty late here too |
Okay I see that you managed the scale using the focal point. Can you share the implementation of |
I am not at my computer now, but that class is probably in the original code of the package. I will have a look in a few minutes
…Sent from my iPhone
On Dec 19, 2022, at 7:56 AM, Venusdjinni ***@***.***> wrote:
Okay I see that you managed the scale using the focal point. Can you share the implementation of scaleTranslateMatrices's class?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
|
I have to go to do something with snow. But I have a file named: matrices_classes.dart. It may be that the original has changed since a couple of years ago. I can see a lot of the functions match, but not all: import 'package:flutter/material.dart'; //based on Matrix Gesture Detector class MatrixDecomposedValues { /// Scaling factor. //2022Aug1 - removed rotation, was not used anyway MatrixDecomposedValues(this.translation, this.scale); @OverRide //From MatrixGestureDetector class _ValueUpdater { _ValueUpdater({this.onUpdate}); T update(T newValue) { class ScaleTranslateMatrices { static final ScaleTranslateMatrices instance = ScaleTranslateMatrices Matrix4 matrix; void resetMatrices() { // Decomposes [matrix] into [MatrixDecomposedValues.translation], //Matrix creation from GestureDetector - composed from translation and scale //hold values and differences in values _ValueUpdater scaleUpdater = _ValueUpdater( Matrix4 translate(Offset translation) { //was _translate Matrix4 scale(double scale, Offset focalPoint) { //was_scale |
After scaling and translating, i tap on the screen. I use the values from MatrixDecompose (translation , scale) to go back to the 'real world without translation and scale' coordinates. They value are always off in Y by the same amount. I am fairly sure it is caused by the AppBar distance. When I remove the AppBar values work.
My problem is I I am not completely sure what is happening, so I might get it wrong on different devices. Also, I would prefer to be able to use the Appbar. I can not find a solution of finding AppBar height. Any Suggestions? What have others done with this problem?
The text was updated successfully, but these errors were encountered: