rsms / scripter

The Scripter Figma plugin
https://figma.com/c/plugin/757836922707087381/
MIT License
190 stars 22 forks source link

[bug] Strange rectangle is created after creating PaintStyle #17

Open ardov opened 3 years ago

ardov commented 3 years ago

After using PaintStyle() the Scripter also creates a rectangle. This rectangle seems to be connected with paint style so I can't delete it without deleting the style.

Steps to reproduce:

Run this script:

PaintStyle({
  name: 'Cyan',
  paints:[
    {
      type: 'SOLID',
      visible: true,
      opacity:  1,
      blendMode: 'NORMAL',
      color: { r: 0, g: 1, b: 1 },
    },
  ]
})

Expected behavior:

Current behavior:

There will also be an error in console after deleting that rectangle: "Uncaught Error: "Encountered style on visible canvas" in softDeleteNode (FGSceneGraph.cpp)".

By the way figma.createPaintStyle() seems to work correctly, this bug only happens with PaintStyle()