mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 22:25:38 +00:00
32546b5874
git-subtree-dir: external/lunasvg git-subtree-split: 7417baa0aff477f361e44e2aa793fdb0c7aae352
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
|