SVG - support radialGradient fr attribute

This commit is contained in:
janekptacijarabaci 2017-08-17 20:27:14 +02:00 committed by Roy Tam
commit 4ba6ca9106
10 changed files with 103 additions and 13 deletions

View file

@ -623,7 +623,7 @@ nsSVGRadialGradientFrame::GradientVectorLengthIsZero()
already_AddRefed<gfxPattern>
nsSVGRadialGradientFrame::CreateGradient()
{
float cx, cy, r, fx, fy;
float cx, cy, r, fx, fy, fr;
cx = GetLengthValue(dom::SVGRadialGradientElement::ATTR_CX);
cy = GetLengthValue(dom::SVGRadialGradientElement::ATTR_CY);
@ -631,6 +631,7 @@ nsSVGRadialGradientFrame::CreateGradient()
// If fx or fy are not set, use cx/cy instead
fx = GetLengthValue(dom::SVGRadialGradientElement::ATTR_FX, cx);
fy = GetLengthValue(dom::SVGRadialGradientElement::ATTR_FY, cy);
fr = GetLengthValue(dom::SVGRadialGradientElement::ATTR_FR);
if (fx != cx || fy != cy) {
// The focal point (fFx and fFy) must be clamped to be *inside* - not on -
@ -651,7 +652,7 @@ nsSVGRadialGradientFrame::CreateGradient()
}
}
RefPtr<gfxPattern> pattern = new gfxPattern(fx, fy, 0, cx, cy, r);
RefPtr<gfxPattern> pattern = new gfxPattern(fx, fy, fr, cx, cy, r);
return pattern.forget();
}