summaryrefslogtreecommitdiffstats
path: root/glow/src/quad.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-21 01:01:47 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-21 01:01:47 +0200
commitd77492c0c37dec1207049b340a318e263cb96b82 (patch)
tree334cb0e1b0ac0a997ad05334290e9522d2e8c3d3 /glow/src/quad.rs
parente0e4ee73feead3f05730625c7e1917b63f0b384e (diff)
downloadiced-d77492c0c37dec1207049b340a318e263cb96b82.tar.gz
iced-d77492c0c37dec1207049b340a318e263cb96b82.tar.bz2
iced-d77492c0c37dec1207049b340a318e263cb96b82.zip
Avoid relying `origin_upper_left`
It seems to cause considerable glitches when resizing.
Diffstat (limited to 'glow/src/quad.rs')
-rw-r--r--glow/src/quad.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/glow/src/quad.rs b/glow/src/quad.rs
index fd71757f..acac3219 100644
--- a/glow/src/quad.rs
+++ b/glow/src/quad.rs
@@ -12,6 +12,7 @@ pub struct Pipeline {
instances: <glow::Context as HasContext>::Buffer,
current_transform: Transformation,
current_scale: f32,
+ current_target_height: u32,
}
impl Pipeline {
@@ -35,6 +36,7 @@ impl Pipeline {
&Transformation::identity().into(),
);
gl.uniform_1_f32(Some(1), 1.0);
+ gl.uniform_1_f32(Some(2), 0.0);
gl.use_program(None);
}
@@ -48,6 +50,7 @@ impl Pipeline {
instances,
current_transform: Transformation::identity(),
current_scale: 1.0,
+ current_target_height: 0,
}
}
@@ -94,6 +97,14 @@ impl Pipeline {
self.current_scale = scale;
}
+ if target_height != self.current_target_height {
+ unsafe {
+ gl.uniform_1_f32(Some(2), target_height as f32);
+ }
+
+ self.current_target_height = target_height;
+ }
+
let mut i = 0;
let total = instances.len();