From 74b27c74af220e30fef274e07f8ad4f19430d217 Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Sun, 7 Mar 2021 12:01:32 +0100 Subject: [PATCH] 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. --- src/lib/sw_engine/tvgSwImage.cpp | 2 +- src/lib/sw_engine/tvgSwShape.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/sw_engine/tvgSwImage.cpp b/src/lib/sw_engine/tvgSwImage.cpp index 5a584437..0c25b5bf 100644 --- a/src/lib/sw_engine/tvgSwImage.cpp +++ b/src/lib/sw_engine/tvgSwImage.cpp @@ -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; } diff --git a/src/lib/sw_engine/tvgSwShape.cpp b/src/lib/sw_engine/tvgSwShape.cpp index 02284ff1..e749aac7 100644 --- a/src/lib/sw_engine/tvgSwShape.cpp +++ b/src/lib/sw_engine/tvgSwShape.cpp @@ -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; }