Jump to content
You must now use your email address to sign in [click for more info] ×

SVG Files missing elements


Recommended Posts

Hello,

Although I am posting this in the affinity designer forum the issue is evident across all three affinity products. 

I have tried opening a .svg file and have noticed that certain elements are not created. If I open the same file using a browser they are rendered correctly. The image below should hopefully demonstrate this the top image shows how it opens in Affinity with the problem areas boxed in red and the bottom is the browser version. My initial thoughts was that this may be font related in that i thought perhaps the missing green flag and the drop down arrow were font icons that were missing in Affinity, however I don't think this is the case as I have opened the .svg in a text editor and these elements look to be defined as paths ( i might be wrong i am no expert) but I think this is also born out by how the area surrounding the number 2 is also not being displayed correctly.

image.png.e80d48438b782d0060b981bbceaff7ad.png

I have attached a copy of the original .svg file in case it helps to troubleshoot this.

Thanks

 

scratchblocks Issue.svg

Link to comment
Share on other sites

  • Staff

Hi Lemonsprig,

Thanks for letting us know. The two icons are using namespace href values (ns1:href and ns2:href) which we're failing to recognise and place the icon accordingly. The Number 2 and its surrounding object is caused by us not recognizing that the SVG defines multiple classes with one fill value.

I've passed this onto development to be investigated. In the meantime I was able to fix the SVG so it would import into Designer correctly

 

scratchblocks Issue-fixed.svg

Link to comment
Share on other sites

Hi Sean,

Thank you for the rely prompt response on this. My love of coding let me to doing a bit of a deep dive on this and I had through a process of elimination and playing with the xml of the .svg come to the same conclusion around the namespace prefix for the icons.

In relation to the background element for the number 2 can I just confirm that all you have done to resolve this is just split both classes into their own definitions so what was previously defined as 

    .sb3-literal-number,
    .sb3-literal-string {
      fill: #575e75;
    }

has become

    .sb3-literal-number {
      fill: #575e75;
    }
    .sb3-literal-string {
      fill: #575e75;
    }

I have quite a few of these .svg files I will need to fix for a project I am working on, and so long as I understand the fix I can work around them manually for now.

Regarding the issue being passed to the dev team, I appreciate that these things can take time to resolve but will there be any notifications in relation to the issue and fixes that I can keep an eye out for?

Ian

 

Link to comment
Share on other sites

  • Staff
1 minute ago, Lemonsprig said:

Hi Sean,

Thank you for the rely prompt response on this. My love of coding let me to doing a bit of a deep dive on this and I had through a process of elimination and playing with the xml of the .svg come to the same conclusion around the namespace prefix for the icons.

In relation to the background element for the number 2 can I just confirm that all you have done to resolve this is just split both classes into their own definitions so what was previously defined as 


    .sb3-literal-number,
    .sb3-literal-string {
      fill: #575e75;
    }

has become


    .sb3-literal-number {
      fill: #575e75;
    }
    .sb3-literal-string {
      fill: #575e75;
    }

I have quite a few of these .svg files I will need to fix for a project I am working on, and so long as I understand the fix I can work around them manually for now.

Regarding the issue being passed to the dev team, I appreciate that these things can take time to resolve but will there be any notifications in relation to the issue and fixes that I can keep an eye out for?

Ian

 

We do try to include our fixes on our patch notes and such so its always worth keeping an eye on those.

That was indeed the fix I did. I assume the comma is intended to apply the style to all classes in the comma separated list? I believe this is where our importer is failing and only applying it to the one containing the style and ignoring all those before it in the list. Its a bit of a nuisance, but hopefully shouldn't be too difficult (especially if all the SVGs use the same list).
 

Link to comment
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.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | 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.