mirror of
https://github.com/servo/servo.git
synced 2025-07-22 06:43:40 +01:00
Fix flip_rect calculation (#32174)
This commit is contained in:
parent
74897c3851
commit
a1f8c19355
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue