mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Skip one single positive linear gradient color stop repeat
We prime `color_stop_list_with_expanded_repeat` with the input `color_stop_list`, so we don't actually need to copy the stops for the first iteration. This didn't result in graphical glitches, but these entries were unnecessary irregardless.
This commit is contained in:
parent
c4e56cc845
commit
868c29545a
Notes:
github-actions[bot]
2025-10-22 08:59:48 +00:00
Author: https://github.com/gmta
Commit: 868c29545a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6533
1 changed files with 2 additions and 2 deletions
|
|
@ -311,7 +311,7 @@ static ColorStopList expand_repeat_length(ColorStopList const& color_stop_list,
|
|||
|
||||
for (auto repeat_count = 1; repeat_count <= negative_repeat_count; repeat_count++) {
|
||||
for (auto stop : color_stop_list.in_reverse()) {
|
||||
stop.position += repeat_length * static_cast<float>(-repeat_count);
|
||||
stop.position -= repeat_length * static_cast<float>(repeat_count);
|
||||
if (stop.position < 0) {
|
||||
stop.color = get_color_between_stops(0.0f, stop, color_stop_list_with_expanded_repeat.first());
|
||||
color_stop_list_with_expanded_repeat.prepend(stop);
|
||||
|
|
@ -321,7 +321,7 @@ static ColorStopList expand_repeat_length(ColorStopList const& color_stop_list,
|
|||
}
|
||||
}
|
||||
|
||||
for (auto repeat_count = 0; repeat_count < positive_repeat_count; repeat_count++) {
|
||||
for (auto repeat_count = 1; repeat_count < positive_repeat_count; repeat_count++) {
|
||||
for (auto stop : color_stop_list) {
|
||||
stop.position += repeat_length * static_cast<float>(repeat_count);
|
||||
if (stop.position > 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue