diff options
| author | vaxerski <vaxry@vaxry.net> | 2025-03-26 11:47:04 +0000 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2025-03-26 11:47:04 +0000 |
| commit | cec084c178de979621cb520aa4f74a40c96567f2 (patch) | |
| tree | 14d934209cea6f21d6d23e6e03f6a55845d33374 /src/render/pass/RectPassElement.cpp | |
| parent | c2ef8fcc0014cfed4e465b184572e6acad9f750f (diff) | |
pass/rect: include clipBox in opaque calculations
ref #9730 ref #9709
Diffstat (limited to 'src/render/pass/RectPassElement.cpp')
| -rw-r--r-- | src/render/pass/RectPassElement.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/render/pass/RectPassElement.cpp b/src/render/pass/RectPassElement.cpp index aa024577..cd354844 100644 --- a/src/render/pass/RectPassElement.cpp +++ b/src/render/pass/RectPassElement.cpp @@ -33,5 +33,13 @@ std::optional<CBox> CRectPassElement::boundingBox() { } CRegion CRectPassElement::opaqueRegion() { - return data.color.a >= 1.F ? boundingBox()->expand(-data.round) : CRegion{}; + if (data.color.a < 1.F) + return CRegion{}; + + CRegion rg = boundingBox()->expand(-data.round); + + if (!data.clipBox.empty()) + rg.intersect(data.clipBox); + + return rg; } |
