Skip to main content
Inspiring
Oct 19, 2026 10:53 PM UTC
Answered

Line and square with the same width/height shows up differently.

Hi there,

 

I have a line and a box in the canvas, and the width is set to be the same. However, when I actually look at the canvas, they seem to show up in different width.

Here is the example:

I am using outline view here to illustrate the problem. As you can see here, the line above is slightly longer than the square below. However, if i check the width of these two objects, they have the same width.

Line:

Square:

They are both aligned to the guide on the left side, and both has the same width. Since they are both snapped onto the guide, I assumed that they both will have the same X but apparently that is not the case. If I try to make the first one using the same X by typing the value, both ends don’t align anymore.

Has anyone experienced similar issue before? It looks like if I draw the square again, it does match the line above so it has something to do with the existing square but I looked around and couldn’t find anything that would indicate what difference could be causing this.

Interestingly, the same thing is also happening for the height as well.

Thanks

    Jacob Bugge
    Jacob BuggeCorrect answer
    Community Expert
    Oct 24, 2026 2:11 PM UTC

    Panda,

     

    I have seen this rather late.

     

    Your (original) screenshots clearly show that

    • You had Use Previews Bounds on (or the Height of the Line would be 0), and
    • Your Stroke Weight is 0.1 mm (the Height of the Line), and
    • You have Butt Cap on (with Projecting Cap on the line would have been aligned with the rectangle.

    This is also reflected in the rectangle perimeter length, which is calculated by the Spine of the path instead of the outer bounds of the Stroke, and it is 34.6 mm instead of 35 mm, each side being 0.1 mm shorter.


    And you are right: you need to redo it, but which way is needed depends on the nature and use of the artwork.

    If your artwork is kept in vector form, in most cases you will be happier if you have Use Preview Bounds off.

    But if the artwork is to fit within the boundaries of a raster image, you will be happier if

    • You Use Preview Bounds and adapt the artwork to that, such as using Projecting Cap on lines, or
    • You have Use Preview Bounds off and create the entire artwork at the final raster size less the Stroke Weight.

     

     

    7 replies

    Participant
    Oct 24, 2026 10:28 AM UTC

    This is almost certainly a stroke issue. The line’s width in the Properties panel (or Transform) often measures the path only, while the square’s width includes its stroke. Illustrator’s default is to use Preview Bounds, which adds half the stroke weight on each side. So two objects with the same number in the field can have different geometric widths.

    Fix:

    1. Go to Preferences > General and uncheck Use Preview Bounds. Now the width fields show the true path size, ignoring stroke.
    2. Or select the square, check its stroke weight, and compare it with the line’s. If one has a stroke and the other doesn’t, or the weights differ, that explains the gap.
    3. If the square was drawn at an earlier point, also check Align Stroke (center/inside/outside) and whether any transform effect is applied under Appearance.

    Redrawing the square matched because the new one got the current default stroke settings, which also fits this cause.

    Translate
    Ton Frederiks
    Community Expert
    Community Expert
    Oct 24, 2026 7:22 AM UTC

    ​@JollyPanda I checked your file and the only way I can reproduce it is by setting the Preferences to “Use Preview Bounds”. Unchecked it will give me 9,9 mm for the line and 10 for the rectangle.

    (the forums currently do not support uploading files, it is a worldwide PHP vulnerability that causes this temorary precaution)

    Translate
    Inspiring
    Oct 23, 2026 11:44 PM UTC

    I apologize for not responding earlier. it slipped my mind, but I just encountered this issue again. This time, I was able to save it as a fine.

    It’s not letting me add image to the post for some reason, so I will explain the file verbally. If you open the file, you will see a line and a square, and two guides on each side. If you click the line, the width in the toolbar will say 10mm.There are two guides placed at both end of this line. If you click the square below it, the width says 10mm, but you can clearly tell there is a gap between the line and the guide on the right side. Outline mode will illustrate this better.

    What’s odd is that, if you click the square, the toolbar shows 10mm x 7.5mm, and so the perimeter of this square should be 2 * (10 + 7.5) = 35, but if you check the size in the Document Info, it shows 34.6mm.

     

    Translate
    Inspiring
    Oct 24, 2026 12:02 AM UTC

    Initially, I thought turning off the “Use Preview Bounds” option didn’t work because but now that I tried again, it did seem to make both width the same by reducing the width of the rectangle (about 0.1mm). However, now i need to go and redo everything ... and also need to check and see what the measurement looks like after printing.

    Translate
    Harshika Verma
    Community Manager
    Community Manager
    Oct 20, 2026 12:46 PM UTC

    Hi JollyPanda,

     

    Thank you for reaching out, and I'm sorry to hear you're having trouble aligning the line and square. In addition to what our expert has asked, could you please record a video of your workflow while recreating both the square and the line for a better understanding of the issue? Did you try recreating the same in a new file?

    Please also share the details of your operating system and the version of Illustrator installed on your machine.

     

    We will try our best to help.

     

    Thanks,

    Harshika

    Translate
    Ton Frederiks
    Community Expert
    Community Expert
    Oct 19, 2026 11:08 PM UTC

    ​@JollyPanda Can you share that document example? Also check if in Preferences the Use Preview Bounds option is checked (if so turn it off).

    Translate