Browse Source

button component debug

master
Odilitime 5 years ago
parent
commit
af167f9140
  1. 5
      src/graphics/components/Component.cpp

5
src/graphics/components/Component.cpp

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
#include <cmath>
#include "TextComponent.h"
#include "InputComponent.h"
#include "ButtonComponent.h"
#include "ComponentBuilder.h"
@ -421,7 +422,11 @@ void Component::printComponentTree(const std::shared_ptr<Component> &component, @@ -421,7 +422,11 @@ void Component::printComponentTree(const std::shared_ptr<Component> &component,
for (int i = 0; i < depth; i++) {
std::cout << '\t';
}
ButtonComponent *butComponent = dynamic_cast<ButtonComponent*>(component.get());
InputComponent *inputComponent = dynamic_cast<InputComponent*>(component.get());
if (butComponent) {
std::cout << std::fixed << "X: " << static_cast<int>(butComponent->x) << " Y: " << static_cast<int>(butComponent->y) << " WIDTH: " << static_cast<int>(butComponent->width) << " HEIGHT: " << static_cast<int>(butComponent->height) << " INLINE: " << butComponent->isInline << " Bound: " << butComponent->boundToPage << " BUTTON: " << butComponent->value << std::endl;
} else
if (inputComponent) {
std::cout << std::fixed << "X: " << static_cast<int>(inputComponent->x) << " Y: " << static_cast<int>(inputComponent->y) << " WIDTH: " << static_cast<int>(inputComponent->width) << " HEIGHT: " << static_cast<int>(inputComponent->height) << " INLINE: " << inputComponent->isInline << " Bound: " << inputComponent->boundToPage << " INPUT: " << inputComponent->value << std::endl;
} else {

Loading…
Cancel
Save