mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
common: allow composition on empty scene without insufficient condition error
If there was an empty scene (empty scene, so bounds equal zero) with a mask composition applied, Paint::Impl::render failed on checking size and Canvas::draw() returned InsufficientCondition. As a result no other paints was rendered. @issue: fixes #842
This commit is contained in:
parent
591ea1d61c
commit
81e6471071
1 changed files with 3 additions and 1 deletions
|
@ -114,10 +114,12 @@ struct Canvas::Impl
|
|||
{
|
||||
if (drawing || paints.count == 0 || !renderer || !renderer->preRender()) return Result::InsufficientCondition;
|
||||
|
||||
bool rendered = false;
|
||||
for (auto paint = paints.data; paint < (paints.data + paints.count); ++paint) {
|
||||
if (!(*paint)->pImpl->render(*renderer)) return Result::InsufficientCondition;
|
||||
if ((*paint)->pImpl->render(*renderer)) rendered = true;
|
||||
}
|
||||
|
||||
if (!rendered) return Result::InsufficientCondition;
|
||||
if (!renderer->postRender()) return Result::InsufficientCondition;
|
||||
|
||||
drawing = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue