ES-DE/source/gelement.cpp
Leon Styhre 32546b5874 Squashed 'external/lunasvg/' content from commit 7417baa0a
git-subtree-dir: external/lunasvg
git-subtree-split: 7417baa0aff477f361e44e2aa793fdb0c7aae352
2022-10-03 18:25:42 +02:00

31 lines
682 B
C++

#include "gelement.h"
#include "layoutcontext.h"
namespace lunasvg {
GElement::GElement()
: GraphicsElement(ElementId::G)
{
}
void GElement::layout(LayoutContext* context, LayoutContainer* current) const
{
if(isDisplayNone())
return;
auto group = std::make_unique<LayoutGroup>();
group->transform = transform();
group->opacity = opacity();
group->masker = context->getMasker(mask());
group->clipper = context->getClipper(clip_path());
layoutChildren(context, group.get());
current->addChildIfNotEmpty(std::move(group));
}
std::unique_ptr<Node> GElement::clone() const
{
return cloneElement<GElement>();
}
} // namespace lunasvg