Effacer les filtres
Effacer les filtres

UIAxes CurrentPosition Bug on Matlab2022B (Was working fine on 2020B)

2 vues (au cours des 30 derniers jours)
FURKAN TULUK
FURKAN TULUK le 28 Mai 2024
Commenté : FURKAN TULUK le 31 Mai 2024
Hello, I have an Appdesigner application and I plot data on UIAxes in my application. I click on the UIAxes plot to pick a point and press a button in UIFigure to find the CurrentPosition of that point, but since it conflicts with UIFigure's CurrentPosition, I find a value independent of UIAxes based on the current position of my mouse. This problem did not exist in Matlab 2020B, but I encountered this situation when I switched to 2022B. How can I solve this problem?

Réponses (1)

Sarthak
Sarthak le 30 Mai 2024
This is interesting. If there is a conflict between the CurrentPosition of UIAxes and UIFigure in MATLAB 2022B, it could be because how CurrentPosition used to be handled has changed.
As a workaround, you can try to create a callback function for the ButtonDownFcn event of the UIAxes. This function will be executed when you click on the UIAxes, and it can store the CurrentPoint property of the UIAxes in a separate variable.
Now, when you press the button in UIFigure, you can access the CurrentPoint of the UIAxes from the handles structure, instead of using the CurrentPosition property of the UIFigure.
Please note that this is a workaround, and it might not work in all situations. Reaching out to MathWorks Technical Support might be a good idea. In case you do, let me know the right way to do it as well. Otherwise the above mentioned workaround should work fine.
  1 commentaire
FURKAN TULUK
FURKAN TULUK le 31 Mai 2024
Hello, I created ButtonDownFcn for UIAxes and the problem was solved. Thanks

Connectez-vous pour commenter.

Catégories

En savoir plus sur Develop uifigure-Based Apps dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by