sw_engine shape/image: substituting logical 'and' with 'or'

In the case when the height or width of the bounding box is 0
it is not necessary to calculate Rle.
This commit is contained in:
Mira Grudzinska 2021-03-07 12:01:32 +01:00 committed by Hermet Park
parent 6e59116137
commit 74b27c74af
2 changed files with 2 additions and 2 deletions

View file

@ -68,7 +68,7 @@ static bool _updateBBox(const SwOutline* outline, SwBBox& bbox, const SwSize& cl
bbox.max.x = min(bbox.max.x, clip.w);
bbox.max.y = min(bbox.max.y, clip.h);
if (xMax - xMin < 1 && yMax - yMin < 1) return false;
if (xMax - xMin < 1 || yMax - yMin < 1) return false;
return true;
}

View file

@ -193,7 +193,7 @@ static bool _updateBBox(const SwOutline* outline, SwBBox& bbox)
bbox.min.y = yMin >> 6;
bbox.max.y = (yMax + 63) >> 6;
if (xMax - xMin < 1 && yMax - yMin < 1) return false;
if (xMax - xMin < 1 || yMax - yMin < 1) return false;
return true;
}