diff options
author | Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me> | 2024-04-29 17:01:31 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-29 08:01:31 +0000 |
commit | a1f8c19355f7e0e673511c24feeae60d47f19c1c (patch) | |
tree | 110fae02338d64df6cc9b5c47463069b91398c7e /components | |
parent | 74897c38512793455f4c1622e2b454b274aa8cec (diff) | |
download | servo-a1f8c19355f7e0e673511c24feeae60d47f19c1c.tar.gz servo-a1f8c19355f7e0e673511c24feeae60d47f19c1c.zip |
Fix flip_rect calculation (#32174)
Diffstat (limited to 'components')
-rw-r--r-- | components/compositing/windowing.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index 7d98f610bec..fc7ef379be1 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -249,7 +249,10 @@ impl EmbedderCoordinates { /// This should be used when drawing directly to the framebuffer with OpenGL commands. pub fn flip_rect(&self, rect: &DeviceIntRect) -> DeviceIntRect { let mut result = *rect; - result.min.y = self.framebuffer.height - result.min.y - result.size().height; + let min_y = self.framebuffer.height - result.max.y; + let max_y = self.framebuffer.height - result.min.y; + result.min.y = min_y; + result.max.y = max_y; result } |