mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
svg_loader: fixing the used mask-type
For the performance reasons, regardless of the set/default mask-type value, if the mask is white, the alpha masking is used. To qualify a mask as white, not only its fill has to be checked, but its stroke as well. The second was missing.
This commit is contained in:
parent
ff3ebd9abd
commit
d1fc538429
1 changed files with 4 additions and 1 deletions
|
@ -594,7 +594,10 @@ static unique_ptr<Scene> _sceneBuildHelper(const SvgNode* node, const Box& vBox,
|
|||
if (isMaskWhite) {
|
||||
uint8_t r, g, b;
|
||||
shape->fillColor(&r, &g, &b, nullptr);
|
||||
if (shape->fill() || r < 255 || g < 255 || b < 255) *isMaskWhite = false;
|
||||
if (shape->fill() || r < 255 || g < 255 || b < 255 || shape->strokeFill() ||
|
||||
(shape->strokeColor(&r, &g, &b, nullptr) == Result::Success && (r < 255 || g < 255 || b < 255))) {
|
||||
*isMaskWhite = false;
|
||||
}
|
||||
}
|
||||
scene->push(move(shape));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue