mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 03:54:25 +00:00
renderer: hotfix
added exceptional handling
This commit is contained in:
parent
92e3c243ec
commit
d5a5e3215c
1 changed files with 5 additions and 1 deletions
|
@ -104,7 +104,11 @@ struct RenderRegion
|
|||
|
||||
static constexpr RenderRegion intersect(const RenderRegion& lhs, const RenderRegion& rhs)
|
||||
{
|
||||
return {{std::max(lhs.min.x, rhs.min.x), std::max(lhs.min.y, rhs.min.y)}, {std::min(lhs.max.x, rhs.max.x), std::min(lhs.max.y, rhs.max.y)}};
|
||||
RenderRegion ret = {{std::max(lhs.min.x, rhs.min.x), std::max(lhs.min.y, rhs.min.y)}, {std::min(lhs.max.x, rhs.max.x), std::min(lhs.max.y, rhs.max.y)}};
|
||||
// Not intersected: collapse to zero-area region
|
||||
if (ret.min.x > ret.max.x) ret.max.x = ret.min.x;
|
||||
if (ret.min.y > ret.max.y) ret.max.y = ret.min.y;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void intersect(const RenderRegion& rhs);
|
||||
|
|
Loading…
Add table
Reference in a new issue