Semantic delta · 5
src/compute/grid/alignment.rs
diff --git a/src/compute/block.rs b/src/compute/block.rs
index 3f6f5fa2f..36a40eb16 100644
--- a/src/compute/block.rs
+++ b/src/compute/block.rs
@@ -1024,10 +1024,8 @@ fn perform_final_layout_on_in_flow_children(
#[cfg(feature = "content_size")]
{
- let content_box_top_left =
- Point { x: resolved_content_box_inset.left, y: resolved_content_box_inset.top };
inflow_content_size = inflow_content_size.f32_max(compute_content_size_contribution(
- location - content_box_top_left,
+ location + Point { x: -resolved_content_box_inset.left, y: -resolved_content_box_inset.top },
final_size,
item_layout.content_size,
item.overflow,
diff --git a/src/compute/flexbox.rs b/src/compute/flexbox.rs
index 5eea0cd2e..b9a482638 100644
--- a/src/compute/flexbox.rs
+++ b/src/compute/flexbox.rs
@@ -1946,18 +1946,11 @@ fn calculate_flex_item(
+ (item.inset.main_start(direction).or(item.inset.main_end(direction).map(|pos| -pos)).unwrap_or(0.0))
};
- let offset_cross = if direction.is_column() && layout_direction.is_rtl() {
- total_offset_cross
- + item.offset_cross
- + item.margin.cross_start(direction)
- + (item.inset.cross_start(direction).or(item.inset.cross_end(direction).map(|pos| -pos)).unwrap_or(0.0))
- } else {
- total_offset_cross
- + item.offset_cross
- + line_offset_cross
- + item.margin.cross_start(direction)
- + (item.inset.cross_start(direction).or(item.inset.cross_end(direction).map(|pos| -pos)).unwrap_or(0.0))
- };
+ let offset_cross = total_offset_cross
+ + item.offset_cross
+ + line_offset_cross
+ + item.margin.cross_start(direction)
+ + (item.inset.cross_start(direction).or(item.inset.cross_end(direction).map(|pos| -pos)).unwrap_or(0.0));
if direction.is_row() {
let baseline_offset_cross =
diff --git a/src/compute/grid/alignment.rs b/src/compute/grid/alignment.rs
index 30eda6747..6dc090a4d 100644
--- a/src/compute/grid/alignment.rs
+++ b/src/compute/grid/alignment.rs
@@ -313,7 +313,8 @@ pub(super) fn align_item_within_area(
// Compute offset in the axis
let alignment_based_offset = match alignment_style {
- AlignSelf::Start | AlignSelf::FlexStart => {
+ // TODO: Add support for baseline alignment. For now we treat it as "start".
+ AlignSelf::Start | AlignSelf::FlexStart | AlignSelf::Baseline | AlignSelf::Stretch => {
if direction.is_rtl() {
free_space + resolved_margin.start
} else {
@@ -328,21 +329,6 @@ pub(super) fn align_item_within_area(
}
}
AlignSelf::Center => (grid_area_size - resolved_size + resolved_margin.start - resolved_margin.end) / 2.0,
- // TODO: Add support for baseline alignment. For now we treat it as "start".
- AlignSelf::Baseline => {
- if direction.is_rtl() {
- free_space + resolved_margin.start
- } else {
- resolved_margin.start
- }
- }
- AlignSelf::Stretch => {
- if direction.is_rtl() {
- free_space + resolved_margin.start
- } else {
- resolved_margin.start
- }
- }
};
let offset_within_area = if position == Position::Absolute {
diff --git a/src/geometry.rs b/src/geometry.rs
index 6ea871d20..987dc06ae 100644
--- a/src/geometry.rs
+++ b/src/geometry.rs
@@ -652,15 +652,6 @@ impl<U, T: Add<U>> Add<Point<U>> for Point<T> {
}
}
-// Generic Sub impl for Point<T> + Point<U> where T + U has an Sub impl
-impl<U, T: Sub<U>> Sub<Point<U>> for Point<T> {
- type Output = Point<<T as Sub<U>>::Output>;
-
- fn sub(self, rhs: Point<U>) -> Self::Output {
- Point { x: self.x - rhs.x, y: self.y - rhs.y }
- }
-}
-
impl<T> Point<T> {
/// Applies the function `f` to both the x and y
///