Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
1use gpui::geometry::rect::RectF; 2 3pub fn paint_layer<F>(cx: &mut gpui::PaintContext, clip_bounds: Option<RectF>, f: F) 4where 5 F: FnOnce(&mut gpui::PaintContext) -> (), 6{ 7 cx.scene.push_layer(clip_bounds); 8 f(cx); 9 cx.scene.pop_layer() 10}