mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 23:24:24 +00:00
Layers panel: an artboard without masks is a compact heading row
It reads strong and draws as rows do at thumbnail size None, so it is never taller than a layer row. An artboard with a mask keeps its thumbnail.
This commit is contained in:
@@ -208,8 +208,14 @@ fn layer_row<'r, T: LayerTree>(cx: &'r PanelContext<'r, T>, id: &T::Id) -> ListR
|
||||
if info.dimmed {
|
||||
row = row.ink(RowInk::Dimmed);
|
||||
}
|
||||
// An artboard without masks heads its layers: a strong row drawn as at thumbnail size None, never taller than a
|
||||
// layer row. With a mask it keeps its thumbnail, which the mask's target and clicks go back to.
|
||||
let compact = info.kind == LayerKind::Artboard && info.masks.is_empty();
|
||||
if compact {
|
||||
row = row.heading();
|
||||
}
|
||||
|
||||
if size != ThumbSize::None {
|
||||
if size != ThumbSize::None && !compact {
|
||||
let host = cx.thumbs;
|
||||
let (layer, kind) = (id.clone(), info.kind);
|
||||
row = row.thumb(size, move |painter, rect| {
|
||||
|
||||
@@ -207,7 +207,8 @@ pub enum LayerKind {
|
||||
Shape,
|
||||
/// A smart object.
|
||||
SmartObject,
|
||||
/// An artboard (rows for artboards are step 6b's; the kind exists for apps that list them).
|
||||
/// An artboard: without masks its row is a heading with no thumbnail, as every row is at
|
||||
/// thumbnail size None.
|
||||
Artboard,
|
||||
/// A path (VectorCraft).
|
||||
Path,
|
||||
|
||||
Reference in New Issue
Block a user