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

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