Anomaly with SVG Component

@dan I just ran into an issue I have never encountered before.

I created an SVG, which is placed inside a container. See below.

This SVG is set to have a WIDTH of 12, as shown here.

But if you look at the SVG in the first screenshot you will see that when selected it is the full width of the content of the container. In this example, I have a transform on the SVG that rotates it 90º. But due to the width being incorrect it rotates using that width.

To correct the problem, I set the left margin on the SVG to 0 and the right one to AUTO, then it displays the correct size when selected. See below.

Now if I perform the transform it does the right thing and rotates in place.

My questions is, why is this happening, is there something I’m doing wrong or some setting I missing on the SVG? I would have thought if I set a hard coded width for a component it would resize to that width. I’ve studied the settings in the container but I don’t see anything that would be forcing the full width on the SVG.

Is this a bug?

Hm, I do have the same setup in a project here. It behaves normal as it should. Did you change the container settings?

Edit: just tried out with a blank container and an svg added into it. It’s not taking up the full width. Did you remove the size attributes in the svg settings (which is really neat way to tidy up that svg code btw. Thanks Realmac :wink: )

Yes, I did have Elements remove all of the info from the SVG.

I just created a new project added a single container and then added an SVG inside the container. I touched none of the container settings other than to add some spacing around the content area. The SVG was automatically set to a width of 20 by Elements, but when it is selected you can see it extends the full width of the container content.

I did not set any other settings for the SVG.

It is worth noting that the size of the actual SVG image is correct, it just the selection size that is incorrect. So if I was now to perform a center rotation transform on the SVG it would rotate out of view as it would be using the center of the width of the container content.

Weird. That never happened to me (yet).

Good catch — that is a little bug that’s slipped through.

I’ve fixed it, and it’ll get included in the next beta :slight_smile:

@ben Awesome. I was beginning to wonder if I was imagining things, as no one else seems to have run into this glitch.

@ben Did this make it into the 0.8.3 build as I’m still seeing the problem?

It’s in 0.8.4 :wink:

1 Like