#include "mbox.h"

#include "widget_utils/layout_utils.h"

void mh_box::arrange_children(const geometry_t& in_allotted_geometry) {
	arrange_box_children<orientation_t::horizontal>(in_allotted_geometry,
	                                                           get_dpi_scale(),
	                                                           visibility_t::any_visible,
	                                                           get_slots());
}

Eigen::Vector2f mh_box::compute_desired_size(float in_layout_scale_multiplier) const {
	cache_all_children_desired_size(in_layout_scale_multiplier, false);
	return compute_box_desired_size<orientation_t::horizontal>(get_slots());
}

void mv_box::arrange_children(const geometry_t& in_allotted_geometry) {
	arrange_box_children<orientation_t::vertical>(in_allotted_geometry,
	                                                         get_dpi_scale(),
	                                                         visibility_t::any_visible,
	                                                         get_slots());
}

Eigen::Vector2f mv_box::compute_desired_size(float in_layout_scale_multiplier) const {
	cache_all_children_desired_size(in_layout_scale_multiplier, false);
	return compute_box_desired_size<orientation_t::vertical>(get_slots());
}
