Layers: the painted thumbnail's comment states the per-frame cost of a long path

Measuring a long path's bounds takes time in proportion to its anchor count on every frame; it does not cost as much as rendering the path.
This commit is contained in:
dotCooCoo
2026-11-05 05:10:41 +07:00
committed by bflatastic
parent b48c62f0cf
commit 570296b97a
+2 -2
View File
@@ -253,8 +253,8 @@ pub(crate) fn real_thumb(ui: &Ui, src: &ThumbSource, n: &Arc<Node>, r: egui::Rec
}
/// Tiny vector thumbnail painted with egui (fallback when rendering isn't possible). A node with
/// more than [`LIGHT_THUMB_ANCHORS`] anchors paints nothing: measuring its bounds takes about as
/// long as rendering it.
/// more than [`LIGHT_THUMB_ANCHORS`] anchors paints nothing, since this runs on every frame and
/// measuring its bounds takes time in proportion to its anchor count.
pub(super) fn thumb(ui: &Ui, n: &Node, r: egui::Rect) {
if !small_node(n, usize::MAX, LIGHT_THUMB_ANCHORS) {
return;