Skip to content

Commit

Permalink
web/core: Fix painting borders
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwuelker committed Dec 9, 2023
1 parent d70a53a commit afe725e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/web/core/src/css/fragment_tree/fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ impl BoxFragment {
x: Pixels::ZERO,
y: self.borders.top,
};
let area = Rectangle::from_corners(border_area.top_left() + state.offset, bottom_right);
let area = Rectangle::from_corners(border_area.top_left(), bottom_right)
.offset_by(state.offset);
let color = *self.style().border_top_color();
painter.rect(area, color.into());
}
Expand All @@ -177,7 +178,8 @@ impl BoxFragment {
x: self.borders.right,
y: Pixels::ZERO,
};
let area = Rectangle::from_corners(top_left + state.offset, border_area.bottom_right());
let area = Rectangle::from_corners(top_left, border_area.bottom_right())
.offset_by(state.offset);
let color = *self.style().border_right_color();
painter.rect(area, color.into());
}
Expand All @@ -189,7 +191,8 @@ impl BoxFragment {
x: Pixels::ZERO,
y: self.borders.bottom,
};
let area = Rectangle::from_corners(top_left + state.offset, border_area.bottom_right());
let area = Rectangle::from_corners(top_left, border_area.bottom_right())
.offset_by(state.offset);
let color = *self.style().border_bottom_color();
painter.rect(area, color.into());
}
Expand All @@ -201,7 +204,8 @@ impl BoxFragment {
x: self.borders.left,
y: Pixels::ZERO,
};
let area = Rectangle::from_corners(border_area.top_left() + state.offset, bottom_right);
let area = Rectangle::from_corners(border_area.top_left(), bottom_right)
.offset_by(state.offset);
let color = *self.style().border_left_color();
painter.rect(area, color.into());
}
Expand Down

0 comments on commit afe725e

Please sign in to comment.