mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 09:49:21 +00:00
LibWeb/Painting: Only calculate light/dark border color that's used
We previously calculated both before deciding which one we wanted.
This commit is contained in:
parent
c7166527ce
commit
b2dea4577a
Notes:
github-actions[bot]
2025-07-02 13:17:03 +00:00
Author: https://github.com/AtkinsSJ
Commit: b2dea4577a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5271
Reviewed-by: https://github.com/gmta ✅
1 changed files with 8 additions and 7 deletions
|
@ -54,13 +54,14 @@ Gfx::Color border_color(BorderEdge edge, BordersDataDevicePixels const& borders_
|
||||||
}();
|
}();
|
||||||
|
|
||||||
if (border_data.line_style == CSS::LineStyle::Inset) {
|
if (border_data.line_style == CSS::LineStyle::Inset) {
|
||||||
auto top_left_color = dark_color_for_inset_and_outset(border_data.color);
|
if (edge == BorderEdge::Left || edge == BorderEdge::Top)
|
||||||
auto bottom_right_color = light_color_for_inset_and_outset(border_data.color);
|
return dark_color_for_inset_and_outset(border_data.color);
|
||||||
return (edge == BorderEdge::Left || edge == BorderEdge::Top) ? top_left_color : bottom_right_color;
|
return light_color_for_inset_and_outset(border_data.color);
|
||||||
} else if (border_data.line_style == CSS::LineStyle::Outset) {
|
}
|
||||||
auto top_left_color = light_color_for_inset_and_outset(border_data.color);
|
if (border_data.line_style == CSS::LineStyle::Outset) {
|
||||||
auto bottom_right_color = dark_color_for_inset_and_outset(border_data.color);
|
if (edge == BorderEdge::Left || edge == BorderEdge::Top)
|
||||||
return (edge == BorderEdge::Left || edge == BorderEdge::Top) ? top_left_color : bottom_right_color;
|
return light_color_for_inset_and_outset(border_data.color);
|
||||||
|
return dark_color_for_inset_and_outset(border_data.color);
|
||||||
}
|
}
|
||||||
|
|
||||||
return border_data.color;
|
return border_data.color;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue