2022-10-03 16:25:42 +00:00
|
|
|
#include "gelement.h"
|
|
|
|
#include "layoutcontext.h"
|
|
|
|
|
|
|
|
namespace lunasvg {
|
|
|
|
|
|
|
|
GElement::GElement()
|
2022-10-16 10:31:43 +00:00
|
|
|
: GraphicsElement(ElementID::G)
|
2022-10-03 16:25:42 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|