SVGs not aligning properly unless empty objects in Layers are deleted
When I import an image in SVG format the alignment tools do not work properly to align the image with other elements on the artboard. I've found a work around for this, deleting the "title" layer of the SVG in the layers panel seems to allow it to work properly. There is no graphic information in the title layer as far as I'm aware so why does it affect how the alignment tools work? Also with the title layer still present clicking align moves it every time it's clicked rather than just once, how it usually behaves. I've attached a screen capture in GIF of what I've experienced.
-
Steve, if the file is still something you have, does it look anything like this problem — https://illustrator.uservoice.com/forums/601447/suggestions/45312922 ?
Or that one — http://illustrator.uservoice.com/forums/601447/suggestions/48131336 ? -
Several objects were made in Illustrator and exported to SVGs.
Later they were imported back into Illustrator.
Please take a look at both the GIF and the file atached.When one tries to select all the top-level groups and align them to left — it doesn’t work.
Aligning to center and to right works, but once these get aligned to right — aligning to center stops working too.When exploring layers, it’s clear that these groups have something else inside besides rectangles — but only in Layers, not on canvas. These can’t be selected or changed, only rearranged, renamed, deleted.
When these get deleted, aligning works as expected.
If just ungrouped, aligning works as well.If I recall, these are empty groups that Illustrator automatically deletes if a group has no children, but keeps when imported from an SVG, where these are allowed.
I recall even more faintly that there was another related report about these phantom objects, but can’t find it.
-
Alessandro, that’s a good hypothesis!
It can be that or be something lese entirely. That’s why an original document is always needed.
If you ever encounter a problem like this, please don’t hesitate to upload the file here in the comments, to start an investigation going. -
Alessandro Anselmi
commented
Otherwise it could also depend on vertices at the ends of the guides that have not been deleted but are still part of the group of objects to be aligned
In this case (screenshot) you can't vertically alling the red rectangle to the artboard because of those terminal anchor points of the partially deleted guide.
It happens when you select with the direct selection tool the guide to delete -
Alessandro Anselmi
commented
This happened to me too sometimes and I resolved it releasing all the grouped objects and group them again.
You must ungroup all the objects until the ungroup command is no longer available, before grouping them all together again into a single group
I still can't figure out what the source of the misbehavior is, but it's just a workaround -
Ali, I can’t reproduce it, sadly.
I have a suspicion the art you try to align have clipping masks within, but still I fail to make it behave like this.Does it work wrong in a brand new file, with a simpler selection, or it’s file-specific?
Can you share the file if it’s this file’s quirk only? In case you don’t want or just can’t share it publicly — perhaps you can strip it to barebones, so that the bug is reproducible still? Or you can send it to the team directly, at sharewithai@adobe.com (in this case provide a link to this report for tracking purposes: http://illustrator.uservoice.com/forums/601447/suggestions/48131336) -
Ali Mohtaseb commented
Although I'm selecting "Align to Artboard" in Align panel the illustration still jumps away right when I click on Horizontal / Vertical Align Center
-
Somewhere in the object you have an object named '<desc4125>'
You can select it in the Layers, but you can’t target it or select there or select it on canvas visually, because it has nothing but the name.Once you delete it, the group becomes a normal alignable group.
The fact it happens is obviously a bug. Thanks for reporting it!
I’ve attached the simplified file to test the bug, with no actual seal, just an ellipse in a group with that 'desc' thing within.
(Edited by admin) -
Jesse Kendrick
commented
Mac OS Monterey 12.4
Intel Core i5
Adobe Illustrator (desktop) 26.3.1When I use the align panel or the toolbar to align the Great Seal of California, an imported .AI file, to the center of the artboard, it instead moves a number of pixels to the right. After multiple attempts, it moves to the edge of the artboard. This error does not affect other assets in the document. The error persists when switching from "align to artboard" to "align to selection".
See attached file.
-
Deono
commented
I don't have screen record software so I can't really do that. On a side note, it's only happened twice since I've posted. (I struggle with it for weeks, finally post about it, and it's barely happened since. Go figure.)
Your group theory has some merit, all of this happened when aligning groups, but I would also open the group and attempt to align a single object within it, but either the art kept moving when tapping button or nothing at all would happen. A restart then corrected the behavior... for awhile, until this week anyway.
I'm wondering if file size is an issue? The files where it occurred the most were rather large for my .ai files, between 500 & 850 meg. These newer files, where it hasn't happened, were much smaller, 40-80 meg. Perhaps I need to break up some larger projects into multiple files instead of trying to keep them all together in one?
-
Yes, I had this too, once or twice, and it involved groups. Was not able to catch it, and nobody else I asked for was. Maybe this time we can figure it out?
Can you record the video or a GIF when it happens? -
Deono
commented
Illustrator version 25.4.1
Mac 10.15.7(Align to) works SOMETIMES, and other times not so much. Doesn't matter if it's set to align to artboard, objects, or selected. Currently can only get it to work properly by shutting down & restarting every time I need to center something after successfully working ONCE. Here's what happens;
1. Layer 1, align to center, worked.
2. Layer 2, align to center, art moved 4 inches to right.
3. Layer 2, align to center, art moved 4 more inches to right.
4. Layer 2, align to left, art does nothing.
5. Layer 2, align to center, art moves another 4 inches to right and out of bounds of ALL artboards.
6. Shut down Illustrator.
7. Launch Illustrator.
8. Layer 2, Align to center, works! Hurray!
9. Layer 3, Align to center, art moves 4 inches to right.
10. Repeat.It certainly seems to be a software issues as it continues to move the art each time the button is pressed instead of moving only one time to reach the align point.
It's almost as if Illustrator is reseting center point to a different location each time the button is pressed, instead of moving the art to the center point, it moves the center point THEN moves to art to that new center. That's how it appears, I'm sure it's much more complicated.
Please fix, this is super annoying to have to shut down and restart the app every 2nd time an align is needed.
-
Teodora Puican
commented
I am selecting an artboard. Then selecting my item. When I try to center them using Horizontal/Vertical Align Center, my item completely ignores my artboard (and any other artboard for that matter) and positions itself randomly.
Version 25.0
This feature is essential for us since we need to center dozens of icons for export.
-
Steve Gehring commented
Alignment with the new version seems to be erratic. Selected are not aligning to the middle that are jumping all over the place
-
Anonymous
commented
Solution:
Don't drag and drop the SVG in the Ai rather open it in a new window of Ai and then copy and paste the SVG in your working artboard, hopefully, it will work. It is working for me this way. -
Daniel J. Lewis
commented
I can confirm the exact behavior. For me, it was in SVGs I downloaded from Icomoon.io. The alignment and distribution tools would produce weird results, and clicking the same buttons again would further move the imported graphic.
I also found I could ungroup and delete the blank item, but that's very cumbersome. Removing the <title> line from the SVG source code fixed these issues for me.
Because the <title> line is there for accessibility, I think Illustrator should seek to fix this bug instead of our having to edit all our SVGs.
-
Anonymous
commented
I've experienced this issue as well for a few versions of Illustrator. I'm trying to submit a bug for the same issue but it doesn't look like it's going to upload. I've found a work around for this, if you delete the <title> layer that is grouped to the SVG from the layers panel then the image aligns properly, at least in my experience. I would still say this is a bug and it's really annoying to have to delete every title layer for every icon when making a UI when you expect that the align tools should work how they do with everything else.
-
Kurt
commented
I added an SVG to use (with File/Place) and wanted it to be centered. After clicking to align to artboard and clicking the Horizontal Align Center button it never actually centers. It moves a bit each click until it stops working all together (almost parabolic as seen in the attached gif).
Everything worked fine on objects created from within that file