lwc_string_unref(svg_name_lwc);
dom_string_unref(svg_name);
- /* get graphic dimensions */
+ /* initialize the state struct with zeros */
memset(&state, 0, sizeof(state));
+
+ /* get graphic dimensions */
state.diagram = diagram;
state.document = document;
state.viewport_width = viewport_width;
state.viewport_height = viewport_height;
-
/* Initialize CSS context */
- if (state.select_ctx == NULL) {
- css_code = css_select_ctx_create(&state.select_ctx);
- if (css_code != CSS_OK) {
- dom_node_unref(svg);
- dom_node_unref(document);
- return svgtiny_LIBCSS_ERROR;
- }
+ css_code = css_select_ctx_create(&state.select_ctx);
+ if (css_code != CSS_OK) {
+ dom_node_unref(svg);
+ dom_node_unref(document);
+ return svgtiny_LIBCSS_ERROR;
}
#define SVGTINY_STRING_ACTION2(s,n) \