Skip to content

Commit 868c295

Browse files
committed
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.
1 parent c4e56cc commit 868c295

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static ColorStopList expand_repeat_length(ColorStopList const& color_stop_list,
311311

312312
for (auto repeat_count = 1; repeat_count <= negative_repeat_count; repeat_count++) {
313313
for (auto stop : color_stop_list.in_reverse()) {
314-
stop.position += repeat_length * static_cast<float>(-repeat_count);
314+
stop.position -= repeat_length * static_cast<float>(repeat_count);
315315
if (stop.position < 0) {
316316
stop.color = get_color_between_stops(0.0f, stop, color_stop_list_with_expanded_repeat.first());
317317
color_stop_list_with_expanded_repeat.prepend(stop);
@@ -321,7 +321,7 @@ static ColorStopList expand_repeat_length(ColorStopList const& color_stop_list,
321321
}
322322
}
323323

324-
for (auto repeat_count = 0; repeat_count < positive_repeat_count; repeat_count++) {
324+
for (auto repeat_count = 1; repeat_count < positive_repeat_count; repeat_count++) {
325325
for (auto stop : color_stop_list) {
326326
stop.position += repeat_length * static_cast<float>(repeat_count);
327327
if (stop.position > 1) {

0 commit comments

Comments
 (0)