Skip to main content
Rosieway
Aug 29, 2023 11:13 PM UTC
Solved

How to fix the 1/2 pixel off on "line object" component on Figma?

Hi there, I just discovered that the “line object” on Figma is always 1/2 pixel off. No matter how you adjust the stroke to be in the center, inside or outside.

Is there a way to make it become a full pixel? I want to create a line object and make it into component. However, the outline of the component will never wrap the line object to its edge but always 1/2 pixel inlined.

Here is what it looks like:

Thank you!

This topic has been closed for replies.
tank666
tank666Solution
Sep 1, 2023 7:15 AM UTC

This is a GIF from the “Explore auto layout properties” article in the Help Center.

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank

15 replies

MartinBajac
New Member
Aug 30, 2023 3:41 AM UTC

Line vectors are created with 1/2 pixel to it’s left of the center line and another 1/2 pixel to the right of the center line. When creating components, Figma takes the start point of the center line of the vector and the last point of the center line of the vector, and creates the box you showed above, with half a pixel on the outside. Taking this into account and further research, I don’t think there is an appropriate solution for this issue.

tank666
Aug 30, 2023 7:29 AM UTC

Wrap your vector with a stroke in an auto layout frame or add an auto layout property to your component and

Figma Learn - Help Center
UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
Jairo
Aug 30, 2023 7:41 AM UTC

Your Stroke is not closed, so options like “Inside” or “Outside”, cannot be applied.
Think of it: Inside relative to what?

Jairo
Aug 30, 2023 7:49 AM UTC

If you want to draw a stroke that is 1px wide and don’t fall into the subpixel space, then you have to make your vector into that subpixel:


Note: The red mark shows the vector pen position when approaching to the subpixel grid. The shape on the left succesfully shows a 1 px vector that fills an entire pixel

With the pen tool you can draw directly into the subpixel grid, so when applying a stroke to the vector created it will fill an entire pixel.

Basic shapes will be created inside the regular pixel grid.
To make them go subpixel you can either alter the coordinates X/Y by 0.5px or enter in vector edit mode and move the nodes to the subpixel grid.

Rosieway
RosiewayAuthor
Aug 31, 2023 7:45 PM UTC

Thanks so much @tank666 The auto layout stroke included works just like magic!!!

Bryce_Driesenga
Active Member
Aug 31, 2023 10:04 PM UTC

Okay, you gotta tell me what you recorded that GIF with!

Rosieway
RosiewayAuthor
Aug 31, 2023 10:06 PM UTC

@tank666 Curious +1

tank666
tank666Solution
Sep 1, 2023 7:15 AM UTC

This is a GIF from the “Explore auto layout properties” article in the Help Center.

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
Bryce_Driesenga
Active Member
Sep 2, 2023 6:21 PM UTC

Dang, the quality is great. So curious how they optimized it.

Bryce_Driesenga
Active Member
Sep 5, 2023 7:20 PM UTC

@Rosieway I don’t know what they used, but I did come across https://gif.ski/ and it seems to do pretty great converting videos to GIFs!