delegate draw to persons

This commit is contained in:
vrd
2022-12-24 17:59:54 +02:00
parent 5e9d2d8501
commit cd221476a5
4 changed files with 47 additions and 22 deletions
+13 -15
View File
@@ -7,11 +7,6 @@
using std::cout;
Tree::Tree()
: treeName("Unnamed")
, numPeople(0)
{}
Tree Tree::operator+ (const Tree& other)//
{
Tree result(treeName + other.treeName); //The tree resulting from the addition
@@ -442,18 +437,21 @@ void Tree::removeRelation(const unsigned firstId, const unsigned secondId)
void Tree::draw() const
{
WINDOW* father = people[0].createPad();
WINDOW* mother = people[1].createPad();
/* WINDOW* father = people[0].createPad(); */
/* WINDOW* mother = people[1].createPad(); */
U16 fw = getmaxx(father); /* return size, not coords */
U16 fh = getmaxy(father);
U16 mw = getmaxx(mother);
U16 mh = getmaxy(mother);
/* U16 fw = getmaxx(father); /\* return size, not coords *\/ */
/* U16 fh = getmaxy(father); */
/* U16 mw = getmaxx(mother); */
/* U16 mh = getmaxy(mother); */
U16 drawX = (COLS - fw - mw) / 2;
pnoutrefresh(father, 0, 0,
1, drawX,
1 +fh-1, drawX + fw-1);
/* U16 drawX = (COLS - fw - mw) / 2; */
/* pnoutrefresh(father, 0, 0, */
/* 1, drawX, */
/* 1 +fh-1, drawX + fw-1); */
people[0].draw(0, 0);
/* pnoutrefresh(mother, 0, 0, 1, d */