Public function

Fit a frame to its content.

Signature
function fitFrameToContent(
  editor: Editor,
  id: TLShapeId,
  opts?: {
    padding: number
  }
): void
Parameters
NameDescription

editor

Editor

tlraw editor instance.

id

TLShapeId

Id of the frame you wish to fit to content.

opts

{
  padding: number
}

Options for fitting the frame.

Returns
void
References

Editor, TLShapeId

Source

packages/tldraw/src/lib/utils/frames/frames.ts

FeatureFlagsFitFrameToContentMenuItem