Fix format. Try compile on Windows.

This commit is contained in:
ArthurSonzogni
2020-03-22 22:32:44 +01:00
parent 4ff45ee540
commit a402cb4fbb
67 changed files with 615 additions and 569 deletions

View File

@@ -10,7 +10,7 @@ Node::Node(std::vector<std::unique_ptr<Node>> children)
Node::~Node() {}
void Node::ComputeRequirement() {
for(auto& child : children)
for (auto& child : children)
child->ComputeRequirement();
}
@@ -19,20 +19,20 @@ void Node::SetBox(Box box) {
}
void Node::Render(Screen& screen) {
for(auto& child : children)
for (auto& child : children)
child->Render(screen);
}
void Render(Screen& screen, Node* node) {
// Step 1: Find what dimension this elements wants to be.
node->ComputeRequirement();
Box box;
box.x_min = 0;
box.y_min = 0;
box.x_max = screen.dimx() - 1;
box.y_max = screen.dimy() - 1;
// Step 2: Assign a dimension to the element.
node->SetBox(box);
screen.stencil = box;