LibWeb: Make sure painted CSS borders are snapped to integer pixels
This is a bit of a hack to get box content to stop bleeding 1px outside the border sometimes. We will need to come up with a more general solution for this problem eventually.
This commit is contained in:
parent
9201f626c1
commit
1b15144e78
Notes:
sideshowbarker
2024-07-17 20:20:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1b15144e78a
1 changed files with 5 additions and 1 deletions
|
@ -37,8 +37,12 @@ BorderRadiusData normalized_border_radius_data(Layout::Node const& node, Gfx::Fl
|
|||
return BorderRadiusData { top_left_radius_px, top_right_radius_px, bottom_right_radius_px, bottom_left_radius_px };
|
||||
}
|
||||
|
||||
void paint_border(PaintContext& context, BorderEdge edge, Gfx::FloatRect const& rect, BorderRadiusData const& border_radius_data, BordersData const& borders_data)
|
||||
void paint_border(PaintContext& context, BorderEdge edge, Gfx::FloatRect const& a_rect, BorderRadiusData const& border_radius_data, BordersData const& borders_data)
|
||||
{
|
||||
// FIXME: This is a hack that snaps the incoming rect to integer pixel values before painting each side.
|
||||
// This needs a more general solution.
|
||||
auto rect = enclosing_int_rect(a_rect).to_type<float>();
|
||||
|
||||
const auto& border_data = [&] {
|
||||
switch (edge) {
|
||||
case BorderEdge::Top:
|
||||
|
|
Loading…
Add table
Reference in a new issue