|
@@ -25,10 +25,10 @@ public class FolderNode : StructureNode, IReadOnlyFolderNode, IClipSource, IPrev
|
|
|
public override Node CreateCopy() => new FolderNode { MemberName = MemberName };
|
|
|
|
|
|
public override VecD GetScenePosition(KeyFrameTime time) =>
|
|
|
- documentSize / 2f; //GetTightBounds(time).GetValueOrDefault().Center;
|
|
|
+ documentSize / 2f;
|
|
|
|
|
|
public override VecD GetSceneSize(KeyFrameTime time) =>
|
|
|
- documentSize; //GetTightBounds(time).GetValueOrDefault().Size;
|
|
|
+ documentSize;
|
|
|
|
|
|
protected override void OnExecute(RenderContext context)
|
|
|
{
|
|
@@ -126,24 +126,31 @@ public class FolderNode : StructureNode, IReadOnlyFolderNode, IClipSource, IPrev
|
|
|
|
|
|
public override RectD? GetTightBounds(KeyFrameTime frameTime)
|
|
|
{
|
|
|
- RectI bounds = new RectI();
|
|
|
+ RectI? bounds = null;
|
|
|
if (Content.Connection != null)
|
|
|
{
|
|
|
Content.Connection.Node.TraverseBackwards((n) =>
|
|
|
{
|
|
|
- if (n is ImageLayerNode imageLayerNode)
|
|
|
+ if (n is StructureNode structureNode)
|
|
|
{
|
|
|
- RectI? imageBounds = (RectI?)imageLayerNode.GetTightBounds(frameTime);
|
|
|
+ RectI? imageBounds = (RectI?)structureNode.GetTightBounds(frameTime);
|
|
|
if (imageBounds != null)
|
|
|
{
|
|
|
- bounds = bounds.Union(imageBounds.Value);
|
|
|
+ if (bounds == null)
|
|
|
+ {
|
|
|
+ bounds = imageBounds;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ bounds = bounds.Value.Union(imageBounds.Value);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
});
|
|
|
|
|
|
- return (RectD)bounds;
|
|
|
+ return (RectD?)bounds ?? RectD.Empty;
|
|
|
}
|
|
|
|
|
|
return null;
|
|
@@ -165,32 +172,6 @@ public class FolderNode : StructureNode, IReadOnlyFolderNode, IClipSource, IPrev
|
|
|
return guids;
|
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// Creates a clone of the folder, its mask and all of its children
|
|
|
- /// </summary>
|
|
|
- /*internal override Folder Clone()
|
|
|
- {
|
|
|
- var builder = ImmutableList<StructureMember>.Empty.ToBuilder();
|
|
|
- for (var i = 0; i < Children.Count; i++)
|
|
|
- {
|
|
|
- var child = Children[i];
|
|
|
- builder.Add(child.Clone());
|
|
|
- }
|
|
|
-
|
|
|
- return new Folder
|
|
|
- {
|
|
|
- GuidValue = GuidValue,
|
|
|
- IsVisible = IsVisible,
|
|
|
- Name = Name,
|
|
|
- Opacity = Opacity,
|
|
|
- Children = builder.ToImmutable(),
|
|
|
- Mask = Mask?.CloneFromCommitted(),
|
|
|
- BlendMode = BlendMode,
|
|
|
- ClipToMemberBelow = ClipToMemberBelow,
|
|
|
- MaskIsVisible = MaskIsVisible
|
|
|
- };
|
|
|
- }*/
|
|
|
-
|
|
|
public override RectD? GetPreviewBounds(int frame, string elementFor = "")
|
|
|
{
|
|
|
if (elementFor == nameof(EmbeddedMask))
|