mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-30 01:55:39 +00:00
0d52738239
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
38 lines
923 B
C++
38 lines
923 B
C++
#include "clippathelement.h"
|
|
#include "parser.h"
|
|
#include "layoutcontext.h"
|
|
|
|
namespace lunasvg {
|
|
|
|
ClipPathElement::ClipPathElement()
|
|
: GraphicsElement(ElementId::ClipPath)
|
|
{
|
|
}
|
|
|
|
Units ClipPathElement::clipPathUnits() const
|
|
{
|
|
auto& value = get(PropertyId::ClipPathUnits);
|
|
return Parser::parseUnits(value, Units::UserSpaceOnUse);
|
|
}
|
|
|
|
std::unique_ptr<LayoutClipPath> ClipPathElement::getClipper(LayoutContext* context) const
|
|
{
|
|
if(context->hasReference(this))
|
|
return nullptr;
|
|
|
|
LayoutBreaker layoutBreaker(context, this);
|
|
auto clipper = std::make_unique<LayoutClipPath>();
|
|
clipper->units = clipPathUnits();
|
|
clipper->transform = transform();
|
|
clipper->clipper = context->getClipper(clip_path());
|
|
layoutChildren(context, clipper.get());
|
|
return clipper;
|
|
}
|
|
|
|
std::unique_ptr<Node> ClipPathElement::clone() const
|
|
{
|
|
return cloneElement<ClipPathElement>();
|
|
}
|
|
|
|
} // namespace lunasvg
|