mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 14:48:24 +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
9d7cd877e8
commit
f56879b295
1 changed files with 6 additions and 2 deletions
|
@ -214,8 +214,12 @@ bool Paint::Impl::render(RenderMethod* renderer)
|
|||
RenderRegion region;
|
||||
PAINT_METHOD(region, bounds(renderer));
|
||||
|
||||
if (MASK_REGION_MERGING(compData->method)) region.add(P(compData->target)->bounds(renderer));
|
||||
if (region.w == 0 || region.h == 0) return true;
|
||||
auto cData = compData;
|
||||
while (cData) {
|
||||
if (MASK_REGION_MERGING(cData->method)) region.add(P(cData->target)->bounds(renderer));
|
||||
if (region.w == 0 || region.h == 0) return true;
|
||||
cData = P(cData->target)->compData;
|
||||
}
|
||||
cmp = renderer->target(region, COMPOSITE_TO_COLORSPACE(renderer, compData->method), CompositionFlag::Masking);
|
||||
if (renderer->beginComposite(cmp, CompositeMethod::None, 255)) {
|
||||
compData->target->pImpl->render(renderer);
|
||||
|
|
Loading…
Add table
Reference in a new issue