Jump to content
Friksel

[AD WIN - also beta] Applying a single effect adds additional wrapper-group on SVG-export

Recommended Posts

When exporting a rectangle to svg without effects the result is as expected:

<rect x="420" y="260" width="460" height="200" style="fill:#ebebeb;"/>

But when we add an effect, like gaussian blur to that rectangle the svg-exporter automatically generates a wrapper-group around the element just to apply the effect:

<g style="filter:url(#_Effect1);">
   <rect x="420" y="260" width="460" height="200" style="fill:#ebebeb;"/>
</g>

This is what I would expect instead:

<rect x="420" y="260" width="460" height="200" style="fill:#ebebeb;" style="filter:url(#_Effect1);"/>

I understand wrapper groups could be a way to stack effects if we want to use more than one effect on an object (although even then svg allows filters to be chained via their 'in'-attributes), but that's not the case here because we just use a single effect. 

If we only apply one effect to an object, in my opinion the effect should go directly to the style-attribute of the element itself instead of creating additional groups and with that changing the hierarchy of the layout. Also when having more than one effect applied to an element the first effect should go in the style of the element itself.

Adding these additional groups makes the svg output overly complex and large and in Javascript we now need to keep track of/set two different elements when controlling attributes both on the element itself as well as switching the single effect of the group above dynamically.

I might be missing something here, but I searched through all of Designer and in the svg-exporter options, but couldn't find any setting to prevent these extra groups to be created on exports. I also tested this in the last Designer beta (1.6.5.112), but it has the exact same behaviour.

Please add at least the first effect to the svg-element itself and prevent adding groups as much as possible.
[edit] Please put svg effects directly to the graphical element or use svg effects chaining instead. Don't create additional groups/change hierarchy. Leave the structure in svg output 1 on 1 the same as created in Designer. And meant by the designer


 

Share this post


Link to post
Share on other sites

Friksel, this is more of a feature request than a bug, as both are acceptable SVG aren't they? What does this extra group additional hierarchy do that you think is wrong? Does it affect other apps or using the SVG in browsers or what? This is more my ignorance than denying there may be a problem (that you understand)


Patrick Connor
Serif Europe Ltd

Latest releases on each platform 

 

Share this post


Link to post
Share on other sites
23 minutes ago, Patrick Connor said:

Friksel, this is more of a feature request than a bug, as both are acceptable SVG aren't they? What does this extra group additional hierarchy do that you think is wrong? Does it affect other apps or using the SVG in browsers or what? This is more my ignorance than denying there may be a problem (that you understand)

Hi @Patrick Connor, thanks for your response and I understand your question. The thing is this IS affecting our apps because Javascript can't read the attributes it needs from the elements anymore that should be in the output, causing apps to fail. In Designer we picked a 'rectangle', so we need to have a 'rectangle' as output, not a path. It's like a factory creating a car with wheels and when the car is leaving the factory suddenly the wheels are glued to the frame so the wheels can't spin anymore. As a car is useless with glued wheels, shapes are useless as paths, because they lack all attributes we need to 'spin' them (scale, position, change rounded corner-radius and so on).

Think of bar graphs for example. A designer generates bars with rounded rectangles so the developer can use the attributes (with, height, x and y, but also rx and ry) to animate the bars with javascript for the web. Even this very simple example is now suddenly very difficult and complex to do with paths, is way to complex for such a simple task and leeds to all kind of problems and a lot less performance and way too much code, resulting in everything to be larger and slower. So basically this is pretty useless for real world professional usecases.

Please keep in mind that SVG is not meant to be used as an exchange-format to exchange vector-graphics between graphic software, but most of the time the output of the design, used directly on internet-pages and a lot of times even controlled by css and javascript for animations and interactive applications. 
Btw, also if people use svg to move graphics from one software program to another, instead of exchanging the .designer, .ai, .pdf or .eps instead, Designer is still changing the design on export: it's converting simple objects to paths. And it is not supposed to do that, it's supposed to keep the layout the same on export as far as possible for the given format.

To come back to the issue: having paths as outputs instead of rectangles is not right and pretty useless. It prevents the elements from being used in apps. It's also inconsistent, unwanted and unexpected behaviour. Therefor I call this an issue, rather than a feature request.


 

Share this post


Link to post
Share on other sites

@Patrick Connor Ow wow, I only see now I thought you were reacting to the other thread I just opened, the one about rounded rectangles here:

But basically the same could be said on this issue as well: having the svg-exporter create additional groups 'on its own'  (without us knowing it) is not right, because we (must be able to) rely that the svg output hierarchy is be the same as build in Designer as far as the export-format allows it and svg does. Even with multiple effects applied to an object we still don't want extra redundant svg <g> (group) elements to be automatically added, 'cause svg can chain effects with their 'in'-attributes so we only need one filter set per graphical element, even if there are more effects applied. Basically the system works exacly the same as in the editor of Designer. So the output should be 1 on 1 the same hierarchy making sure we can rely on the svg-output to be the same hierarchy as meant by the creator of the design in Designer.

Instead it should be: what you see in Designer is what you get in the svg-export. And it's not. Next to because of the fact that this is causing overly complex and large svg-files and splitting parameters of one object into different svg-elements, causing overly complex javascript to read and write these attributes, I call this an issue rather than a feature request.


 

Share this post


Link to post
Share on other sites
On 7/3/2018 at 12:18 PM, Chris B said:

Hi Friksel,

This was already logged with our developers. They have already started to make some improvements but it is not fixed just yet. 

Hi @Chris B, It's been almost a year since your last post. I see now in the latest 1.7 version (1.7 RC2) it's not fixed yet. Any news on this?


 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.