penpot / penpot-plugins

Repository for developing and running Penpot plugins with examples and libraries.
Mozilla Public License 2.0
27 stars 4 forks source link

insertChild and appendChild always creates shapes on RootFrame #155

Closed girafic closed 2 months ago

girafic commented 2 months ago
const elementParent = selectedElement?.parent;
...
elementParent.insertChild(0, penpot.createRectangle());
elementParent.appendChild(penpot.createEllipse());
...

When adding new rectangles or ellipses to the parent frame of a selected element, the methods insertChild and appendChild will add the new elements to the Root Frame, not to parent frame.

grafik

-->

grafik
Alotor commented 2 months ago

Thanks for the report. The problem was in the parent retrieval wasn't setting well the permissions. I've fixed and we be in develop soon.

girafic commented 2 months ago

Thanks for the report. The problem was in the parent retrieval wasn't setting well the permissions. I've fixed and we be in develop soon.

Would be nice if you could also deploy the changes to early.penpot.dev 😊