question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SvgDocoument.Transforms is null

See original GitHub issue

https://github.com/vvvv/SVG/blob/master/Source/SvgElement.cs#L383

get { return GetAttribute<SvgTransformCollection>("transform", false); }

Which forwards to https://github.com/vvvv/SVG/blob/master/Source/SvgElement.cs#L299

SvgAttributeCollection.GetAttribute and SvgAttributeCollection.GetInheritedAttribute return null, which - in the end - violates best practice (a collection should never be null, but rather empty).

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
wieslawsoltescommented, Jan 8, 2021

though we would have to check the performance implications here, as this may be called quite often.

We have benchmarks for that now.

I am working of Parse optimizations in #786 and I have noticed sometimes type converters return default objects for null values and sometimes not. Definitely memory usage will increase if we create transforms collection for each objects (and all svg visual elements have transforms). I can do benchmarks to showcase how much it will increase.

1reaction
dittodholecommented, Nov 24, 2019

to validate my point, please see https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/guidelines-for-collections#collection-properties-and-return-values

X DO NOT return null values from collection properties or from methods returning collections. Return an empty collection or an empty array instead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

d3 - SVG's documentElement turns null after appending to ...
documentElement is null. I've tried appending a documentElement.cloneNode() instead, and while that fixes the null issue, the SVG graphics aren' ...
Read more >
transform - SVG: Scalable Vector Graphics - MDN Web Docs
The transform attribute defines a list of transform definitions that are applied to an element and the element's children.
Read more >
Transforms on SVG Elements
For starters, CSS transforms on SVG elements don't work in IE. ... and the x parameters makes the value invalid and no transform...
Read more >
Document Structure — SVG 2
An SVG document fragment can range from an empty fragment (i.e., no content inside of the 'svg' ... Purpose: To allow transforms on...
Read more >
I'm trying to remove transforms if my image is an svg? Any ...
I'm trying to remove transforms if my image is an svg? Any tips or advice would be great · Ask Question. Asked 1...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found