Page 1 of 1

Canvas removeShape help

Posted: Fri Mar 05, 2021 1:38 am
by rickbarlow
CanvasIcon old;
timelineCanvas = screenSpaceCanvasFactory.createCanvas(ScreenSpaceCanvasType.RIGHT_OF_TIMELINE);
timelineCanvas.removeShape(old);

I am trying to remove an old CanvasIcon after I am done with it using the code above, but the icon remains on the screen. Is there something else that I need to do? I have N number of icons that I want to remain on the screen, and just the one to be removed.
 

Re: Canvas removeShape help

Posted: Fri Mar 05, 2021 9:56 am
by Svyatoslav
Are you sure the icon that you are removing is actually the same one you added? I assume your code sample is incomplete (uninitialized variable, freshly created canvas with no icons has icon removed from it), so if possible please provide a more complete example.

Re: Canvas removeShape help

Posted: Mon Mar 15, 2021 8:40 pm
by rickbarlow
User error. I found the problem in my code. Thanks.