- Determine the position and size of the left panel: You can get this information from the Position property of the panel.
- Set up the 'WindowButtonMotionFcn' callback for the figure: This callback will be executed whenever the mouse moves within the figure window.
- In the callback function, check the cursor's position. Use the 'CurrentPoint' property of the figure to get the cursor's position.
- Compare the cursor's position to the left panel's boundaries. If the cursor is within the left panel, disable the rotation interaction on the plot; otherwise, enable it.
Point cloud rotate beyond plot limit (App Design based)
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello!
My app has two panels: on the left data input, on the right plot results. My problem is: the plot can be rotated even when the mouse cursor appears on the left panel. How can i prevent this? The user could accidentally rotate the plot when changing input data.
The plot parent is a grid, children of the right panel.
Thank you
0 Commenti
Risposte (1)
Raghav Bansal
il 28 Dic 2023
Hi Veronica,
To prevent the plot from rotating when the mouse is over the left panel, you can use the 'WindowButtonMotionFcn' callback of the figure to detect the cursor's position and disable the rotation if the cursor is over the left panel. You'll need to determine the boundaries of the left panel in the figure's coordinate system and then check if the cursor's position is within those boundaries.
Here's a step-by-step approach you can follow:
Hope it helps!
Regards,
Raghav
0 Commenti
Vedere anche
Categorie
Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!