fix: layout didn't call Widget constructor.

This commit is contained in:
Andrea Blankenstijn 2021-08-12 16:06:33 +02:00
parent 09dffb63dd
commit 85837167fe
2 changed files with 3 additions and 1 deletions

View File

@ -17,7 +17,7 @@ namespace bwidgets
VERTICAL
} alignment;
AlignedLayout(Alignment align) noexcept : alignment(align) {}
AlignedLayout(Alignment align, Widget* p = nullptr) noexcept : Layout(p), alignment(align) {}
[[nodiscard]] auto size() const noexcept -> Size override;
};

View File

@ -30,6 +30,8 @@ namespace bwidgets
Size margins = default_margins;
Layout(Widget* p = nullptr) : Widget(p) {}
auto handle_event(const SDL_Event&) -> Layout* override;
[[nodiscard]] auto size() const noexcept -> Size override = 0;