Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::svg::components::ComputedRadialGradientComponent Struct Reference

Computed properties for a "<radialGradient>" element. More...

#include "donner/svg/components/paint/RadialGradientComponent.h"

Collaboration diagram for donner::svg::components::ComputedRadialGradientComponent:
[legend]

Public Member Functions

void inheritAttributes (EntityHandle handle, EntityHandle base)
 Inherit unset attributes from entity base.
 

Public Attributes

Lengthd cx = Lengthd(50, Lengthd::Unit::Percent)
 The x-coordinate of the gradient center, defaults to 50%.
 
Lengthd cy = Lengthd(50, Lengthd::Unit::Percent)
 The y-coordinate of the gradient center, defaults to 50%.
 
Lengthd r = Lengthd(50, Lengthd::Unit::Percent)
 The radius of the gradient, defaults to 50%.
 
std::optional< Lengthdfx
 The x-coordinate of the gradient focus point, defaults to cx.
 
std::optional< Lengthdfy
 The y-coordinate of the gradient focus point, defaults to cy.
 
Lengthd fr = Lengthd(0, Lengthd::Unit::Percent)
 The radius of the gradient focus point, defaults to 0%.
 

Detailed Description

Computed properties for a "<radialGradient>" element.

This is used to store the resolved properties, replacing unset values with defaults and inheriting from parent elements.

For fx and fy, if they are not specified they will coincide with cx cy, see https://www.w3.org/TR/SVG2/pservers.html#RadialGradientElementFXAttribute. Represent this by using std::nullopt, which will be resolved to cx/cy at the time of rendering.

Member Function Documentation

◆ inheritAttributes()

void donner::svg::components::ComputedRadialGradientComponent::inheritAttributes ( EntityHandle handle,
EntityHandle base )

Inherit unset attributes from entity base.

Parameters
handleCurrent entity to modify.
baseThe entity to inherit unset attributes from.

The documentation for this struct was generated from the following files: