Merge remote-tracking branch 'upstream/master' into yoda-wayland-only
# Conflicts: # Cargo.lock # Cargo.toml # wgpu/Cargo.toml # wgpu/src/window/compositor.rs
This commit is contained in:
commit
d24bcd0272
36 changed files with 475 additions and 209 deletions
|
|
@ -83,13 +83,20 @@ impl<T: Layer> Stack<T> {
|
|||
/// Pushes a new clipping region in the [`Stack`]; creating a new layer in the
|
||||
/// process.
|
||||
pub fn push_clip(&mut self, bounds: Rectangle) {
|
||||
let bounds = bounds * self.transformation();
|
||||
let bounds = bounds
|
||||
.intersection(&self.layers[self.current].bounds())
|
||||
.unwrap_or(Rectangle {
|
||||
width: 0.0,
|
||||
height: 0.0,
|
||||
..bounds
|
||||
});
|
||||
|
||||
self.previous.push(self.current);
|
||||
|
||||
self.current = self.active_count;
|
||||
self.active_count += 1;
|
||||
|
||||
let bounds = bounds * self.transformation();
|
||||
|
||||
if self.current == self.layers.len() {
|
||||
self.layers.push(T::with_bounds(bounds));
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue