summaryrefslogtreecommitdiffstats
path: root/wgpu/src/layer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-04-05 01:24:34 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-04-05 01:24:34 +0200
commit4a356cfc16f3b45d64826732009d9feeac016b28 (patch)
tree6d562490507cd33c9f0660654716d848f2d7349d /wgpu/src/layer.rs
parent394e599c3a096b036aabdd6f850c4a7c518d44fa (diff)
downloadiced-4a356cfc16f3b45d64826732009d9feeac016b28.tar.gz
iced-4a356cfc16f3b45d64826732009d9feeac016b28.tar.bz2
iced-4a356cfc16f3b45d64826732009d9feeac016b28.zip
Enable clipping and disable v-sync for now
Diffstat (limited to 'wgpu/src/layer.rs')
-rw-r--r--wgpu/src/layer.rs35
1 files changed, 17 insertions, 18 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 1c9638b0..d415da72 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -183,26 +183,26 @@ impl Stack {
}
pub fn push_clip(&mut self, bounds: Option<Rectangle>) {
- // self.previous.push(self.current);
- // self.order.push(Kind::Live);
-
- // self.current = self.live_count;
- // self.live_count += 1;
-
- // let bounds = bounds.map(|bounds| bounds * self.transformation());
-
- // if self.current == self.live.len() {
- // self.live.push(Live {
- // bounds,
- // ..Live::default()
- // });
- // } else {
- // self.live[self.current].bounds = bounds;
- // }
+ self.previous.push(self.current);
+ self.order.push(Kind::Live);
+
+ self.current = self.live_count;
+ self.live_count += 1;
+
+ let bounds = bounds.map(|bounds| bounds * self.transformation());
+
+ if self.current == self.live.len() {
+ self.live.push(Live {
+ bounds,
+ ..Live::default()
+ });
+ } else {
+ self.live[self.current].bounds = bounds;
+ }
}
pub fn pop_clip(&mut self) {
- // self.current = self.previous.pop().unwrap();
+ self.current = self.previous.pop().unwrap();
}
pub fn push_transformation(&mut self, transformation: Transformation) {
@@ -219,7 +219,6 @@ impl Stack {
}
pub fn iter_mut(&mut self) -> impl Iterator<Item = LayerMut<'_>> {
- dbg!(self.order.len());
let mut live = self.live.iter_mut();
let mut cached = self.cached.iter_mut();