Skip to content

Bounds property causes side-effect #275

Open
@markdou812

Description

@markdou812

I ran into a very confusing situation when using this library due to a side-effect caused by accessing the Bounds get-property. In my case I was accessing the bounds for spans, of a parent text, and the bounds of the spans were incorrect until I first accessed the parent text's Bounds get-property. After accessing the parent bounds, the children spans' bounds changed to the correct values.
According to CA1024: Use properties where appropriate, a method is more appropriate then a property if: "The Get method has an observable side effect. Retrieving the value of a field does not produce any side effects."
I attached a very simple console app which demonstrates the problem.
SvgNet_ExampleOf_GetProperty_SideEffect.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions