mirror of
https://github.com/storytold/cadcraft.git
synced 2026-11-13 01:10:18 -06:00
fix(render): a loose list holding block references gets the index
This commit is contained in:
@@ -222,7 +222,8 @@ pub(crate) fn with_point_view(d: &Drawing, space: &Space, opts: &Options) -> Opt
|
||||
o
|
||||
}
|
||||
|
||||
/// Loose entity lists shorter than this look layers up by scanning them rather than building an index.
|
||||
/// Loose entity lists shorter than this, with no block reference (whose contents expand to many
|
||||
/// objects), look layers up by scanning rather than building an index.
|
||||
const SMALL_LIST: usize = 64;
|
||||
|
||||
/// Build the display list for a set of loose entities (previews, rubber bands).
|
||||
@@ -236,7 +237,11 @@ pub fn build_entities<'a, I: IntoIterator<Item = &'a Entity>>(d: &Drawing, ents:
|
||||
} else {
|
||||
opts
|
||||
};
|
||||
let layers = if ents.len() < SMALL_LIST { LayerIndex::linear() } else { LayerIndex::new(d) };
|
||||
let layers = if ents.len() < SMALL_LIST && !ents.iter().any(|e| matches!(e.kind, EntityKind::Insert(_))) {
|
||||
LayerIndex::linear()
|
||||
} else {
|
||||
LayerIndex::new(d)
|
||||
};
|
||||
let mut b = Builder {
|
||||
list: DisplayList::default(),
|
||||
opts,
|
||||
|
||||
Reference in New Issue
Block a user