Skip to content

Commit

Permalink
A few edits of SVG stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
calvertdw committed Oct 15, 2024
1 parent 890a86c commit ee02c77
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class BehaviorTreeSVGWriter
private int i = 0;
private int x = 100;
private int y = 100;
private int actionSequenceIndex = 0;
private int actionSequenceX = x;
private int actionSequenceY = y;
private final ArrayList<BehaviorTreeSVGNode> svgNodes = new ArrayList<>();
Expand All @@ -29,16 +30,23 @@ public BehaviorTreeSVGWriter(BehaviorTreeNodeState node)
{
if (child instanceof ActionSequenceState)
{
actionSequenceIndex = i;
actionSequenceX = x;
actionSequenceY = y;
}

if (child.getDefinition().getName().equals("Set static for approach"))
{

}


BehaviorTreeSVGNode svgNode = new BehaviorTreeSVGNode(svgGraphics2D, child, svgNodes, i, x, y);
svgNodes.add(svgNode);

y += svgNode.getHeight();

if (svgNodes.size() % 12 == 0)
if ((svgNodes.size() - (actionSequenceIndex + 1)) % 12 == 0)
y = actionSequenceY + 30;

++i;
Expand Down

0 comments on commit ee02c77

Please sign in to comment.