refactor: add tui.have_top_layer

This commit is contained in:
CJ van den Berg 2025-12-01 15:42:32 +01:00
parent aaca270de4
commit 3221e2dd39
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1624,6 +1624,11 @@ pub fn top_layer(opts: renderer.Layer.Options) ?*renderer.Plane {
return self.top_layer_.?.plane(); return self.top_layer_.?.plane();
} }
pub fn have_top_layer() bool {
const self = current();
return self.top_layer_ != null;
}
fn top_layer_reset(self: *Self) void { fn top_layer_reset(self: *Self) void {
if (self.top_layer_) |top_layer_| { if (self.top_layer_) |top_layer_| {
top_layer_.deinit(); top_layer_.deinit();