Fix naive merging logic in layer::Stack

This commit is contained in:
Héctor Ramón Jiménez 2025-08-17 00:04:45 +02:00
parent d3e9547079
commit c639c185d3
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 46 additions and 7 deletions

View file

@ -303,7 +303,23 @@ impl graphics::Layer for Layer {
self.images.clear();
}
fn level(&self) -> usize {
fn start(&self) -> usize {
if !self.quads.is_empty() {
return 0;
}
if !self.primitives.is_empty() {
return 1;
}
if !self.images.is_empty() {
return 2;
}
return 3;
}
fn end(&self) -> usize {
if !self.text.is_empty() {
return 3;
}