Vertical layout mode and layout align stretch

I have a FrameNode that is set like this:

  const formFrame = figma.createFrame();
  formFrame.layoutMode = 'VERTICAL';
  formFrame.layoutAlign = 'STRETCH';
  formFrame.counterAxisSizingMode = 'FIXED';
  formFrame.primaryAxisSizingMode = 'FIXED'
  formFrame.itemSpacing = 100;
  formFrame.verticalPadding = 64;
  formFrame.resize(592, baseFrame.height);
  baseFrame.appendChild(formFrame);

This will set the frame’s horizontal resizing mode to FIXED and it’s vertical resizing mode to FILL. If layoutAlign is set to STRETCH shouldn’t the horizontal resizing mode be set to FILL? And if the layoutGrow is set to 1 (it is not set to 0 but if it were), shouldn’t the vertical resizing mode be set to FILL? Why is it the other way around when the layoutMode is set to VERTICAL?

It depends on the direction of the baseFrame auto layout. As per the docs:

layoutAlign
Applicable only on direct children of auto-layout frames, ignored otherwise. Determines if the layer should stretch along the parent’s counter axis. Defaults to “INHERIT”.

1 Like