aboutsummaryrefslogtreecommitdiffstats
path: root/include/litehtml/render_flex.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/litehtml/render_flex.h')
-rw-r--r--include/litehtml/render_flex.h29
1 files changed, 8 insertions, 21 deletions
diff --git a/include/litehtml/render_flex.h b/include/litehtml/render_flex.h
index 5d31bc9b..6a03b98e 100644
--- a/include/litehtml/render_flex.h
+++ b/include/litehtml/render_flex.h
@@ -2,32 +2,17 @@
#define LITEHTML_RENDER_FLEX_H
#include "render_block.h"
+#include "flex_item.h"
+#include "flex_line.h"
namespace litehtml
{
class render_item_flex : public render_item_block
{
- struct flex_item
- {
- std::shared_ptr<render_item> el;
- int base_size;
- int main_size;
- int min_width;
- int max_width;
- int line;
-
- explicit flex_item(std::shared_ptr<render_item> _el) :
- el(std::move(_el)),
- min_width(0),
- max_width(0),
- line(0),
- base_size(0),
- main_size(0)
- {}
- };
- protected:
- std::list<std::unique_ptr<flex_item>> m_flex_items;
+ std::list<flex_line> m_lines;
+ std::list<flex_line> get_lines(const containing_block_context &self_size, formatting_context *fmt_ctx, bool is_row_direction,
+ int container_main_size, bool single_line);
int _render_content(int x, int y, bool second_pass, const containing_block_context &self_size, formatting_context* fmt_ctx) override;
public:
@@ -38,8 +23,10 @@ namespace litehtml
{
return std::make_shared<render_item_flex>(src_el());
}
- void draw_children(uint_ptr hdc, int x, int y, const position* clip, draw_flag flag, int zindex) override;
std::shared_ptr<render_item> init() override;
+
+ int get_first_baseline() override;
+ int get_last_baseline() override;
};
}