Reuse only the last layer after merging in layer::Stack
This commit is contained in:
parent
4d93837094
commit
c1f7345ceb
1 changed files with 5 additions and 1 deletions
|
|
@ -115,7 +115,11 @@ impl<T: Layer> Stack<T> {
|
|||
&& previous_layer.bounds() == current_layer.bounds()
|
||||
{
|
||||
previous_layer.merge(current_layer);
|
||||
self.active_count -= 1;
|
||||
|
||||
// We can reuse the last layer
|
||||
if self.current + 1 == self.active_count {
|
||||
self.active_count -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue