mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
LibWeb: Use repeat tile mode if repeating length specified
...for radial gradient in Skia painter.
This commit is contained in:
parent
fb03f36cfa
commit
4aba38e21f
Notes:
sideshowbarker
2024-07-17 03:03:15 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/4aba38e21f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/668
1 changed files with 5 additions and 1 deletions
|
@ -1200,7 +1200,11 @@ CommandResult DisplayListPlayerSkia::paint_radial_gradient(PaintRadialGradient c
|
||||||
// so instead we apply scale matrix
|
// so instead we apply scale matrix
|
||||||
matrix.setScale(size.width() / size.height(), 1.0f, center.x(), center.y());
|
matrix.setScale(size.width() / size.height(), 1.0f, center.x(), center.y());
|
||||||
|
|
||||||
auto shader = SkGradientShader::MakeRadial(center, size.height(), colors.data(), positions.data(), positions.size(), SkTileMode::kClamp, 0, &matrix);
|
SkTileMode tile_mode = SkTileMode::kClamp;
|
||||||
|
if (repeat_length.has_value())
|
||||||
|
tile_mode = SkTileMode::kRepeat;
|
||||||
|
|
||||||
|
auto shader = SkGradientShader::MakeRadial(center, size.height(), colors.data(), positions.data(), positions.size(), tile_mode, 0, &matrix);
|
||||||
|
|
||||||
SkPaint paint;
|
SkPaint paint;
|
||||||
paint.setShader(shader);
|
paint.setShader(shader);
|
||||||
|
|
Loading…
Reference in a new issue