mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:57:35 +00:00
LibGfx: Add support for SVG repeat/reflect gradients
This commit is contained in:
parent
a48b2c1c66
commit
b9294e5fdf
2 changed files with 69 additions and 5 deletions
|
@ -246,13 +246,26 @@ class SVGGradientPaintStyle : public GradientPaintStyle {
|
|||
public:
|
||||
void set_gradient_transform(Gfx::AffineTransform transform);
|
||||
|
||||
enum class SpreadMethod {
|
||||
Pad,
|
||||
Repeat,
|
||||
Reflect
|
||||
};
|
||||
|
||||
void set_spread_method(SpreadMethod spread_method)
|
||||
{
|
||||
m_spread_method = spread_method;
|
||||
}
|
||||
|
||||
protected:
|
||||
Optional<AffineTransform> const& scale_adjusted_inverse_gradient_transform() const { return m_inverse_transform; }
|
||||
float gradient_transform_scale() const { return m_scale; }
|
||||
SpreadMethod spread_method() const { return m_spread_method; }
|
||||
|
||||
private:
|
||||
Optional<AffineTransform> m_inverse_transform {};
|
||||
float m_scale = 1.0f;
|
||||
SpreadMethod m_spread_method { SpreadMethod::Pad };
|
||||
};
|
||||
|
||||
class SVGLinearGradientPaintStyle final : public SVGGradientPaintStyle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue