Move ROI points within app designer

I have x, y values for a line, I'd like to display this line as an ROI line like one created by drawpolyline and then I want to be able to edit the points along the line using my mouse to drag them around. I created a similar app that worked fine using GUIDE but updating to app designer seems to make it imposible to move the points. Here is a simplified version of what I'm doing:
In the startup function:
app.p0 = drawpolyline(app.MainImageAxes,'Position',[0 0],'Visible','off','InteractionsAllowed','all');
In the "Edit line" button callback function:
app.p0.Position = [x y];
app.p0.Visible = 'on';
This successfully creates and draws the line using my x, y values and it looks like an ROI I should be able to edit but trying to drag the points around does nothing. I tried adding draw(app.p0) at the end which just cleared the Position data and made me start creating the line from scratch. When I double click to finish the line I am still unable to edit the points however.
Thanks in advance.

Réponses (0)

Produits

Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by