sketch-hq / SketchAPI

The JavaScript plugin library embedded in Sketch
https://developer.sketch.com/reference/api
MIT License
842 stars 126 forks source link

APIs missing: flatten #895

Open matteogratton opened 2 years ago

matteogratton commented 2 years ago

An API command to flatten a Shape/ShapePath is missing.

Currently we should work with this suggestion: https://github.com/sketch-hq/SketchAPI/issues/139

Flatten is not only a transform to a bitmap, but also a way to apply the changes to a layer and reset its bounding box. For instance, a rotated layer by 45degrees, once flatten lost the rotation value and it's frame takes the current absolute position and size.