blackears / svgSalamander

158 stars 57 forks source link

Out of date documentation? SVGElement.getStyle() #109

Closed frankvdh closed 4 months ago

frankvdh commented 4 months ago

Documentation at https://github.com/blackears/svgSalamander/blob/master/doc/usingSvgSalamander.md includes the following example to get the style of an SVGElement, but it doesn't work.... getStyle does not accept a String parameter. Uing v1.1.4 of SVG Salamander

StyleAttribute attrib = new StyleAttribute(); 
svgElement.getStyle("fill", attrib); 
double value = attrib.getDoubleValue(); 
frankvdh commented 4 months ago

After perusing the source code, it seems the correct usage is:

                StyleAttribute style = new StyleAttribute();
                style.setName("fill");
                svgElement.getStyle(style);
                double value = style.getDoubleValue(); 
blackears commented 4 months ago

I've updated the docs. Thanks.