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)
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
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
|