mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 09:18:42 +09:00
SVG - support radialGradient fr attribute
This commit is contained in:
parent
3a4e49d048
commit
4ba6ca9106
10 changed files with 103 additions and 13 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue