From a1f8c19355f7e0e673511c24feeae60d47f19c1c Mon Sep 17 00:00:00 2001 From: "Ngo Iok Ui (Wu Yu Wei)" Date: Mon, 29 Apr 2024 17:01:31 +0900 Subject: [PATCH] Fix flip_rect calculation (#32174) --- components/compositing/windowing.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }