blob: 0a404845e7fa8707ab802574c8a0a3d7cb5f7e39 [file] [log] [blame]
#include "treelayout.h"
void
OneLevelTreeLayout::setOneLevelLayout(std::vector<Coordinate> &childNodesCo)
{
if (childNodesCo.empty())
{
return;
}
double y = getLevelDistance();
double sd = getSiblingDistance();
int n = childNodesCo.size();
double x = - (n - 1) * sd / 2;
for (int i = 0; i < n; i++)
{
childNodesCo[i].x = x;
childNodesCo[i].y = y;
x += sd;
}
}