Added default color (red): This is done to make sure that in case there is an SVG uploaded by the user which does not have stroke defined, then at least software will be able to show the SVG components.
Read Corrections: Changes were made to how the software read an SVG.
When the object is created, the set of attributes are initialized by their default value.
When the SVG object is read this._attrs is updated with the new values.
For style, the individual properties are also added as separate values, to make updates easier. (the style is also added to this._attrs)
Displaying an SVG: When displaying the SVG, now the style attribute is no longer used, as all of its properties are already in 'this._attrs
Write Corrections: When writing attributes back, a simple which is made to see if that attribute is present in style, if yes then that property in style is updated, else the attribute is written back. The style is added at the end, after all other attributes have been written.
Added an annotation-utils file for re-usability of code.
Changes in accordance to #38
Added default color (red): This is done to make sure that in case there is an SVG uploaded by the user which does not have
stroke
defined, then at least software will be able to show the SVG components.Read Corrections: Changes were made to how the software read an SVG.
this._attrs
is updated with the new values.style
, the individual properties are also added as separate values, to make updates easier. (the style is also added tothis._attrs
)Displaying an SVG: When displaying the SVG, now the
style
attribute is no longer used, as all of its properties are already in'this._attrs
Write Corrections: When writing attributes back, a simple which is made to see if that attribute is present in
style
, if yes then that property in style is updated, else the attribute is written back. Thestyle
is added at the end, after all other attributes have been written.Added an annotation-utils file for re-usability of code.