Revert "sw_engine shape/image: substituting logical 'and' with 'or'"
authorHermet Park <chuneon.park@samsung.com>
Tue, 9 Mar 2021 11:13:44 +0000 (20:13 +0900)
committerHermet Park <chuneon.park@samsung.com>
Thu, 11 Mar 2021 10:03:19 +0000 (19:03 +0900)
This reverts commit 74b27c74af220e30fef274e07f8ad4f19430d217.

This patch breaks Stroke example. 1 line drawings...

There is a possibility that less 1 (i.e: 0.5) width axis-aligned line drawings...

So logically "&&" is correct.

Change-Id: Ia98622d7df464f55a255a35ccb37fc9664ed6954

src/lib/sw_engine/tvgSwImage.cpp
src/lib/sw_engine/tvgSwShape.cpp

index 0c25b5b..5a58443 100644 (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;
 }
index e749aac..02284ff 100644 (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;
 }