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:
Mira Grudzinska 2022-02-01 23:34:41 +01:00 committed by Hermet Park
parent ff3ebd9abd
commit d1fc538429

View file

@ -594,7 +594,10 @@ static unique_ptr<Scene> _sceneBuildHelper(const SvgNode* node, const Box& vBox,
if (isMaskWhite) { if (isMaskWhite) {
uint8_t r, g, b; uint8_t r, g, b;
shape->fillColor(&r, &g, &b, nullptr); 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)); scene->push(move(shape));
} }