summaryrefslogtreecommitdiffstats
path: root/glow/src/quad.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-20 20:28:35 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-20 20:28:35 +0200
commita1a5fcfd46622d5b18d1716aa2adb4659835ccf3 (patch)
tree8c9c2468151ebcc517688edc6d0d4867c11c441c /glow/src/quad.rs
parent720e7756f2afe30706b6b1a7fbde86b9f15e1d8c (diff)
downloadiced-a1a5fcfd46622d5b18d1716aa2adb4659835ccf3.tar.gz
iced-a1a5fcfd46622d5b18d1716aa2adb4659835ccf3.tar.bz2
iced-a1a5fcfd46622d5b18d1716aa2adb4659835ccf3.zip
Refactor `Viewport` and `Compositor`
Diffstat (limited to 'glow/src/quad.rs')
-rw-r--r--glow/src/quad.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/glow/src/quad.rs b/glow/src/quad.rs
index 26424b39..fd71757f 100644
--- a/glow/src/quad.rs
+++ b/glow/src/quad.rs
@@ -1,4 +1,4 @@
-use crate::{Transformation, Viewport};
+use crate::Transformation;
use glow::HasContext;
use iced_graphics::layer;
use iced_native::Rectangle;
@@ -54,7 +54,7 @@ impl Pipeline {
pub fn draw(
&mut self,
gl: &glow::Context,
- viewport: &Viewport,
+ target_height: u32,
instances: &[layer::Quad],
transformation: Transformation,
scale: f32,
@@ -64,9 +64,7 @@ impl Pipeline {
gl.enable(glow::SCISSOR_TEST);
gl.scissor(
bounds.x as i32,
- (viewport.height()
- - (bounds.y + bounds.height).min(viewport.height()))
- as i32,
+ (target_height - (bounds.y + bounds.height)) as i32,
bounds.width as i32,
bounds.height as i32,
);