Merge pull request #27909 from DasoTD:fix-ambiguous-rect-assignment

Fix ambiguous operator error in Rect assignment for C++ modules
This commit is contained in:
Alexander Smorkalov 2025-10-16 09:23:48 +03:00 committed by GitHub
commit 00493e603a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1931,7 +1931,7 @@ template<typename _Tp> static inline
Rect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b )
{
if (a.empty() || b.empty()) {
a = Rect();
a = Rect_<_Tp>();
return a;
}
const Rect_<_Tp>& Rx_min = (a.x < b.x) ? a : b;
@ -1945,7 +1945,7 @@ Rect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b )
// Let us first deal with the following case.
if ((Rx_min.x < 0 && Rx_min.x + Rx_min.width < Rx_max.x) ||
(Ry_min.y < 0 && Ry_min.y + Ry_min.height < Ry_max.y)) {
a = Rect();
a = Rect_<_Tp>();
return a;
}
// We now know that either Rx_min.x >= 0, or
@ -1957,7 +1957,7 @@ Rect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b )
a.x = Rx_max.x;
a.y = Ry_max.y;
if (a.empty())
a = Rect();
a = Rect_<_Tp>();
return a;
}