summaryrefslogtreecommitdiffstats
path: root/glow
diff options
context:
space:
mode:
authorLibravatar Ashley Wulber <ashley@system76.com>2022-11-23 14:46:57 -0500
committerLibravatar Ashley Wulber <ashley@system76.com>2022-11-23 14:46:57 -0500
commitefc00b2f412865b975088002cbe3c927ef662e10 (patch)
tree07f7c0ec4243945e23ce2f7bed8549b909e3e87b /glow
parent84c5ee7fb2d716e1d3c35a53a2cd33fcc6fafc3a (diff)
downloadiced-efc00b2f412865b975088002cbe3c927ef662e10.tar.gz
iced-efc00b2f412865b975088002cbe3c927ef662e10.tar.bz2
iced-efc00b2f412865b975088002cbe3c927ef662e10.zip
fix: adjust y position of scissor rectangle
Diffstat (limited to 'glow')
-rw-r--r--glow/src/backend.rs1
-rw-r--r--glow/src/image.rs4
2 files changed, 4 insertions, 1 deletions
diff --git a/glow/src/backend.rs b/glow/src/backend.rs
index 645c5faf..416c3b94 100644
--- a/glow/src/backend.rs
+++ b/glow/src/backend.rs
@@ -130,6 +130,7 @@ impl Backend {
self.image_pipeline.draw(
gl,
+ target_height,
scaled,
scale_factor,
&layer.images,
diff --git a/glow/src/image.rs b/glow/src/image.rs
index 234583e9..955fd1ab 100644
--- a/glow/src/image.rs
+++ b/glow/src/image.rs
@@ -142,6 +142,7 @@ impl Pipeline {
pub fn draw(
&mut self,
mut gl: &glow::Context,
+ target_height: u32,
transformation: Transformation,
_scale_factor: f32,
images: &[layer::Image],
@@ -192,7 +193,8 @@ impl Pipeline {
unsafe {
gl.scissor(
layer_bounds.x as i32,
- layer_bounds.y as i32,
+ (target_height - (layer_bounds.y + layer_bounds.height))
+ as i32,
layer_bounds.width as i32,
layer_bounds.height as i32,
);