|
|
@@ -27,6 +27,7 @@
|
|
|
*/
|
|
|
|
|
|
#include "LayoutTableDetails.h"
|
|
|
+#include "LayoutDetails.h"
|
|
|
#include "../../Include/RmlUi/Core/Element.h"
|
|
|
#include <algorithm>
|
|
|
#include <float.h>
|
|
|
@@ -296,42 +297,12 @@ void TableGrid::PushRow(Element* element_row, ElementList cell_elements)
|
|
|
open_cells.erase(open_cells.begin(), it_cells_in_row_end);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-ComputedTrackSize BuildComputedColumnSize(const ComputedValues& computed)
|
|
|
-{
|
|
|
- return ComputedTrackSize{
|
|
|
- computed.width,
|
|
|
- computed.min_width, computed.max_width,
|
|
|
- computed.padding_left, computed.padding_right,
|
|
|
- computed.margin_left, computed.margin_right,
|
|
|
- computed.border_left_width, computed.border_right_width,
|
|
|
- computed.box_sizing
|
|
|
- };
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-ComputedTrackSize BuildComputedRowSize(const ComputedValues& computed)
|
|
|
+void TracksSizing::GetEdgeSizes(float& margin_a, float& margin_b, float& padding_border_a, float& padding_border_b, const ComputedAxisSize& computed) const
|
|
|
{
|
|
|
- return ComputedTrackSize{
|
|
|
- computed.height,
|
|
|
- computed.min_height, computed.max_height,
|
|
|
- computed.padding_top, computed.padding_bottom,
|
|
|
- computed.margin_top, computed.margin_bottom,
|
|
|
- computed.border_top_width, computed.border_bottom_width,
|
|
|
- computed.box_sizing
|
|
|
- };
|
|
|
-}
|
|
|
-
|
|
|
-void TracksSizing::GetEdgeSizes(float& margin_a, float& margin_b, float& padding_border_a, float& padding_border_b, const ComputedTrackSize& computed) const
|
|
|
-{
|
|
|
- margin_a = ResolveValue(computed.margin_a, table_initial_content_size);
|
|
|
- margin_b = ResolveValue(computed.margin_b, table_initial_content_size);
|
|
|
-
|
|
|
- padding_border_a = Math::Max(0.0f, ResolveValue(computed.padding_a, table_initial_content_size)) + Math::Max(0.0f, computed.border_a);
|
|
|
- padding_border_b = Math::Max(0.0f, ResolveValue(computed.padding_b, table_initial_content_size)) + Math::Max(0.0f, computed.border_b);
|
|
|
+ LayoutDetails::GetEdgeSizes(margin_a, margin_b, padding_border_a, padding_border_b, computed, table_initial_content_size);
|
|
|
}
|
|
|
|
|
|
-void TracksSizing::ApplyGroupElement(const int index, const int span, const ComputedTrackSize& computed)
|
|
|
+void TracksSizing::ApplyGroupElement(const int index, const int span, const ComputedAxisSize& computed)
|
|
|
{
|
|
|
RMLUI_ASSERT(span >= 1 && index + span - 1 < (int)metrics.size());
|
|
|
|
|
|
@@ -351,7 +322,7 @@ void TracksSizing::ApplyGroupElement(const int index, const int span, const Comp
|
|
|
metric_last.sum_margin_b = margin_b;
|
|
|
}
|
|
|
|
|
|
-void TracksSizing::ApplyTrackElement(const int index, const int span, const ComputedTrackSize& computed)
|
|
|
+void TracksSizing::ApplyTrackElement(const int index, const int span, const ComputedAxisSize& computed)
|
|
|
{
|
|
|
RMLUI_ASSERT(span >= 1 && index + span - 1 < (int)metrics.size());
|
|
|
|
|
|
@@ -384,7 +355,7 @@ void TracksSizing::ApplyTrackElement(const int index, const int span, const Comp
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void TracksSizing::ApplyCellElement(const int index, const int span, const ComputedTrackSize& computed)
|
|
|
+void TracksSizing::ApplyCellElement(const int index, const int span, const ComputedAxisSize& computed)
|
|
|
{
|
|
|
// Merge the metrics of the cell with the existing track: If the existing track
|
|
|
// has auto min-/max-/size, we use the cell's min-/max-/size if it has any.
|
|
|
@@ -429,7 +400,7 @@ void TracksSizing::ApplyCellElement(const int index, const int span, const Compu
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void TracksSizing::InitializeSize(TrackMetric& metric, float& margin_a, float& margin_b, float& padding_border_a, float& padding_border_b, const ComputedTrackSize& computed, const int span, const Style::BoxSizing target_box) const
|
|
|
+void TracksSizing::InitializeSize(TrackMetric& metric, float& margin_a, float& margin_b, float& padding_border_a, float& padding_border_b, const ComputedAxisSize& computed, const int span, const Style::BoxSizing target_box) const
|
|
|
{
|
|
|
RMLUI_ASSERT(span >= 1);
|
|
|
|