- 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 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Raghav Bansal
2023-12-28
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!