You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
460 B
13 lines
460 B
#include "PElement.h" |
|
#include "../TextNode.h" |
|
#include <iostream> |
|
|
|
std::unique_ptr<Component> PElement::render(const Node &node, int y, int windowWidth, int windowHeight) { |
|
if (!node.children.empty()) { |
|
TextNode *textNode = dynamic_cast<TextNode*>(node.children[0].get()); |
|
if (textNode) { |
|
return std::make_unique<TextComponent>(textNode->text, 0, y, 12, false, windowWidth, windowHeight); |
|
} |
|
} |
|
return nullptr; |
|
}
|
|
|