aboutsummaryrefslogtreecommitdiffstats
path: root/include/litehtml/render_image.h
blob: e85f487caf942fd4bbeae699f36cc84b3cad4e23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef LITEHTML_RENDER_IMAGE_H
#define LITEHTML_RENDER_IMAGE_H

#include "render_item.h"

namespace litehtml
{
	class render_item_image : public render_item
	{
	protected:
		int calc_max_height(int image_height, int containing_block_height);
		int _render(int x, int y, const containing_block_context &containing_block_size, formatting_context* fmt_ctx, bool second_pass) override;

	public:
		explicit render_item_image(std::shared_ptr<element>  src_el) : render_item(std::move(src_el))
		{}

		std::shared_ptr<render_item> clone() override
		{
			return std::make_shared<render_item_image>(src_el());
		}
	};
}

#endif //LITEHTML_RENDER_IMAGE_H