For a Symbol node, the transformation based on the 'viewBox', 'width'
and 'height' attributes has to be applied before the transformation
based on the 'transformation' attribute.
Symbol file generation for compiling test code in CI fails.
It's not caused by recent patches.
We don't test until we know the exact cause.
However, loader test is added to check the safety of window build.
Error Log
[45/68] Generating symbol file src/thorvg-0.dll.p/thorvg-0.dll.symbols
FAILED: src/thorvg-0.dll.p/thorvg-0.dll.symbols
"C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts\meson" "--internal" "symbolextractor" "D:\a\thorvg\thorvg\build" src/thorvg-0.dll "src\thorvg.lib" src/thorvg-0.dll.p/thorvg-0.dll.symbols
For the performance reasons, regardless of the set/default
mask-type value, if the mask is white, the alpha masking is
used. To qualify a mask as white, not only its fill has to be
checked, but its stroke as well. The second was missing.
For now it's a simple file used to check the styling precedence
and overall correctness.
After the css stylling will be fully introduced a more complex file
can be used,
The css styling has to be applied as the first step of the node
updates. Whereas the updateStyle function should be called
as the last step, after all other node updates are made.
The CData block is read if it's inside the style tag.
In a case when the CData block was just after the style
block, the data was still read, although it shouldn't be.
Fixed.
Defs can be defined at the end of the file. In such a case each
node with a defined class attribute has to be marked and checked
at the final stage of processing - the proper style node has to be found
and its style has to be applied.
Css styling supports now targets defined only by tag or only by name
(tag.name was already supported before).
Also proper precedence of a styling is fixed - flags were not set.
The attribute values should be copied from a style node only if they
were set in the destination node using the attributes (in opocity to
a style attribute). A proper copyCssStyleAttr() function is introduced.
A function pointer added as an additional arg in order to make it
possible to use these functions to create a normal nodes and also
nodes defined inside a style tag. These two cases need to be parsed
using different functions: simpleXmlParseAttributes() and
simpleXmlParseW3CAttribute().
Function simpleXmlParseCSSAttribute() used to parse the data inside the style tag.
For now the supported formats are: tag {}, .name {}, tag.name{}
_svgLoaderParserXmlStyle() used to deal with the results of the above - to create
the proper nodes. Will work after create...Node() are changed.
Note:
The geometric attributes are not copied from the node defining the style
to the node using it. The SVG2 standard has to be checked to decide
whether it should be supported.
For now it is assumed that only one style element is defined
in an svg file, although it can be easily changed if needed.
The style node will be used to define the style applied to a node
of a given type or in a case when a class attrib was used.
It's the first step in introducing the css inline style sheets into tvg.
For now the class attribute is set only for SvgNodes (not for grads),
it's not used yet.
This would fail building with Visual Studio 2017, at least downstream in Godot
where we undefine old Windows compilers' non-standard `min`/`max` macros (see
`minmax.h`/`NOMINMAX`).