mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
fd498ff35e
ead790126 fix name conflict with rlottie #100 6192f2536 Fix fill default color #105 be5ec7a4f Release v2.3.4 29c32978d Fix std::clamp bug #105 41f21ccb1 Release v2.3.3 git-subtree-dir: external/lunasvg git-subtree-split: ead790126004b86a2dbbe9f4aaf27e82e419721e
53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#include "symbolelement.h"
|
|
#include "parser.h"
|
|
|
|
namespace lunasvg {
|
|
|
|
SymbolElement::SymbolElement()
|
|
: StyledElement(ElementID::Symbol)
|
|
{
|
|
}
|
|
|
|
Length SymbolElement::x() const
|
|
{
|
|
auto& value = get(PropertyID::X);
|
|
return Parser::parseLength(value, AllowNegativeLengths, Length::Zero);
|
|
}
|
|
|
|
Length SymbolElement::y() const
|
|
{
|
|
auto& value = get(PropertyID::Y);
|
|
return Parser::parseLength(value, AllowNegativeLengths, Length::Zero);
|
|
}
|
|
|
|
Length SymbolElement::width() const
|
|
{
|
|
auto& value = get(PropertyID::Width);
|
|
return Parser::parseLength(value, ForbidNegativeLengths, Length::HundredPercent);
|
|
}
|
|
|
|
Length SymbolElement::height() const
|
|
{
|
|
auto& value = get(PropertyID::Height);
|
|
return Parser::parseLength(value, ForbidNegativeLengths, Length::HundredPercent);
|
|
}
|
|
|
|
Rect SymbolElement::viewBox() const
|
|
{
|
|
auto& value = get(PropertyID::ViewBox);
|
|
return Parser::parseViewBox(value);
|
|
}
|
|
|
|
PreserveAspectRatio SymbolElement::preserveAspectRatio() const
|
|
{
|
|
auto& value = get(PropertyID::PreserveAspectRatio);
|
|
return Parser::parsePreserveAspectRatio(value);
|
|
}
|
|
|
|
std::unique_ptr<Node> SymbolElement::clone() const
|
|
{
|
|
return cloneElement<SymbolElement>();
|
|
}
|
|
|
|
} // namespace lunasvg
|