0px layers now take up 1px space with Auto Layout

The Figma team just messaged me saying that a fix to this bug has already been released. I can confirm that I’m not experiencing it on my side anymore :slightly_smiling_face:

4 Likes

Kind of…? If you “touched” any of these misbehaving 0px frames while the bug was out, you need to toggle layers or adjust by 0.5px if they contained other objects, which requires a republish. Unless I’m imagining things.

What you are describing is an issue with how lines work (in all contexts), forget about the line, it is just used to generate a 0 height frame that you can put stuff inside.

Delete it after you have made the the frame around it and put whatever you want inside the frame.

See?

That was fast, much appreciated!

Hey @dvaliao, At the moment, I cannot set the height of a frame in Figma to 0px. Is this a bug, too?
I am asking due to a similar problem: I would like to create an image component with a fixed aspect ratio. A lot of resources therefore use rotated frames with zero height (e.g. 30° to achieve 2:1 images) and I am wondering if this “hack” will work in the long term? Or is there another solution to achieve fixed aspect ratio image components?

I still cannot set a Frame to zero height or width. It defaults to 1. The thread indicates this was fixed… is this fix present on the web app? I do not use desktop version.

Hello All,
I am also experiencing the same problem with Figma’s latest desktop application. Autolayout recognizes zero frames. My goal is to create a strikethrough text effect using the zero-height/frame hack.

Here is what’s happening

Any help would be greatly appreciated

Thanks,
Sachin

@SachInteractz, you are using zero-frame incorrectly. And in general, it is no longer necessary to use it in your case. Just select the line and set its absolute position.

1 Like

Hi @SachInteractz,

Like @tank666 said, I think you’re using them wrong:

  • Using a 0 frame in Height on a Horizontal auto-layout… In this case, you would actually need/want to use a 0 width frame. But like @tank666 said, you don’t need to use this technique anymore, you can just use absolute positioning :slightly_smiling_face:
1 Like

Thank you @tank666 and @Bruno_Garcia1 absolute positioning is the best approach here.

Hey, I was just digging throughAuto Layout Tips & Hacks by @Gleb and found that in his strikethrough example he is also using a zero-height hack. When I copied the same frame and pasted it to my file the auto layout broke as it recognized zero-frame.

Here is what’s happening

Could anyone explain this to me?

Thanks,
Sachin

One can use zero-height in a but the direction has to be vertical.

Your problem is that you are using Auto Layout’s horizontal direction instead of vertical.

2 Likes

You need to set Auto Layout direction to Vertical. To understand the zero-height frames better watch my Config talk:

But you don’t need to use zero-frames anymore since auto layout now supports absolute position.

2 Likes

Yeah Thanks, @Gleb, and @tank666 you guys are awesome

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.