Skip to content

Commit

Permalink
Merge pull request #1 from r888800009/fix_recursion
Browse files Browse the repository at this point in the history
Fixed incorrect parsing recursion order
  • Loading branch information
LunaTheFoxgirl authored Aug 25, 2024
2 parents 25453ad + f9ed4f4 commit 6a0bd41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/kra/layer.d
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public:
*/
bool isLayerUseful()
{
return !isLayerGroup() && (width != 0 && height != 0);
return !isLayerGroup() && (width != 0 && height != 0) || isLayerGroup();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion source/kra/parser.d
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ void importAttributes(ref KRA kra, ref DOMEntity!string layerEntity)
kra.layers ~= paintLayer;
break;
case "grouplayer":
importAttributes(kra, l.children[0]);

auto collapsed = cast(bool) getAttrValue!int(attrs, "collapsed", 0);

auto groupLayer = baseLayer(attrs);
groupLayer.type = (collapsed) ? LayerType.ClosedFolder : LayerType.OpenFolder;
kra.layers ~= groupLayer;

importAttributes(kra, l.children[0]);
Layer groupEnd;
groupEnd.type = LayerType.SectionDivider;
kra.layers ~= groupEnd;
Expand Down

0 comments on commit 6a0bd41

Please sign in to comment.