mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-13 01:56:03 +00:00
renderer: fix render region for multiple masks
Previously, when more than two masks were applied, the render region only took the first added mask into account. @Issue: https://github.com/thorvg/thorvg/issues/3600
This commit is contained in:
parent
761259ca59
commit
7bb701b22e
1 changed files with 6 additions and 2 deletions
|
@ -184,8 +184,12 @@ bool Paint::Impl::render(RenderMethod* renderer)
|
|||
RenderRegion region;
|
||||
PAINT_METHOD(region, bounds(renderer));
|
||||
|
||||
if (MASK_REGION_MERGING(maskData->method)) region.add(PAINT(maskData->target)->bounds(renderer));
|
||||
if (region.invalid()) return true;
|
||||
auto mData = maskData;
|
||||
while (mData) {
|
||||
if (MASK_REGION_MERGING(mData->method)) region.add(PAINT(mData->target)->bounds(renderer));
|
||||
if (region.invalid()) return true;
|
||||
mData = PAINT(mData->target)->maskData;
|
||||
}
|
||||
cmp = renderer->target(region, MASK_TO_COLORSPACE(renderer, maskData->method), CompositionFlag::Masking);
|
||||
if (renderer->beginComposite(cmp, MaskMethod::None, 255)) {
|
||||
maskData->target->pImpl->render(renderer);
|
||||
|
|
Loading…
Add table
Reference in a new issue