mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-17 04:25:39 +00:00
![Leon Styhre](/assets/img/avatar_default.png)
e0f786c9b Fix parseStyle REVERT: d13d8e521 Refactoring REVERT: 4925c87a8 Update REVERT: 794c38591 Update REVERT: 49eee9643 Update REVERT: 914aee5ea Update REVERT: 3bb00ecee Fix ParserString string-view iterator cast in windows REVERT: fabea2008 Fix string-view iterator cast in windows REVERT: bbcf0d34f Update REVERT: 081df20f2 Update REVERT: fe3101f91 Refactoring REVERT: e9a41dc83 Refactoring git-subtree-dir: external/lunasvg git-subtree-split: e0f786c9be6fae1ffabddfe56fb1e0a1a7eb775d
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
|