mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 11:01:54 +00:00
WIP: Introduce layers in renderer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
bfc57cb4f6
commit
859c0f53cb
3 changed files with 12 additions and 12 deletions
|
@ -49,7 +49,9 @@ impl Element for Stack {
|
||||||
ctx: &mut PaintContext,
|
ctx: &mut PaintContext,
|
||||||
) -> Self::PaintState {
|
) -> Self::PaintState {
|
||||||
for child in &mut self.children {
|
for child in &mut self.children {
|
||||||
|
ctx.scene.push_layer();
|
||||||
child.paint(bounds.origin(), ctx);
|
child.paint(bounds.origin(), ctx);
|
||||||
|
ctx.scene.pop_layer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,14 +56,16 @@ impl Scene {
|
||||||
self.layers.as_slice()
|
self.layers.as_slice()
|
||||||
}
|
}
|
||||||
|
|
||||||
// pub fn push_layer(&mut self, clip_bounds: Option<RectF>) {
|
pub fn push_layer(&mut self) {
|
||||||
|
let ix = self.layers.len();
|
||||||
|
self.layers.push(Layer::default());
|
||||||
|
self.active_layer_stack.push(ix);
|
||||||
|
}
|
||||||
|
|
||||||
// }
|
pub fn pop_layer(&mut self) {
|
||||||
|
assert!(self.active_layer_stack.len() > 1);
|
||||||
// pub fn pop_layer(&mut self) {
|
self.active_layer_stack.pop();
|
||||||
// assert!(self.active_layer_stack.len() > 1);
|
}
|
||||||
// self.active_layer_stack.pop();
|
|
||||||
// }
|
|
||||||
|
|
||||||
pub fn push_quad(&mut self, quad: Quad) {
|
pub fn push_quad(&mut self, quad: Quad) {
|
||||||
self.active_layer().push_quad(quad)
|
self.active_layer().push_quad(quad)
|
||||||
|
|
|
@ -70,11 +70,7 @@ impl View for FileFinder {
|
||||||
.with_uniform_padding(6.0)
|
.with_uniform_padding(6.0)
|
||||||
.with_corner_radius(6.0)
|
.with_corner_radius(6.0)
|
||||||
.with_background_color(ColorU::new(0xf2, 0xf2, 0xf2, 0xff))
|
.with_background_color(ColorU::new(0xf2, 0xf2, 0xf2, 0xff))
|
||||||
.with_shadow(
|
.with_shadow(vec2f(0., 4.), 12., ColorF::new(0.0, 0.0, 0.0, 0.25).to_u8())
|
||||||
vec2f(0.0, 4.0),
|
|
||||||
12.0,
|
|
||||||
ColorF::new(0.0, 0.0, 0.0, 0.25).to_u8(),
|
|
||||||
)
|
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
.with_max_width(600.0)
|
.with_max_width(600.0)
|
||||||
|
|
Loading…
Reference in a new issue