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

Created by PaintSystem during render tree instantiation. More...

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

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

Public Member Functions

void inheritAttributesFrom (EntityHandle handle, EntityHandle base)
 Resolve unspecified attributes to default values or inherit from the given base gradient element.
 

Public Attributes

bool initialized = false
 True if this component has been initialized (it has two-phase construction). If this is false, all other fields of this component will be invalid.
 
GradientUnits gradientUnits = GradientUnits::Default
 Resolved value of the "gradientsUnits" attribute, considering inheritance and the default value fallback.
 
GradientSpreadMethod spreadMethod = GradientSpreadMethod::Default
 Resolved value of the "spreadMethod" attribute, considering inheritance and the default value fallback.
 
std::vector< GradientStopstops
 Parsed gradient stops from "<stop>" child elements.
 

Detailed Description

Created by PaintSystem during render tree instantiation.

Since this component may instantiate dependencies on construction, it constructs with two-phase initialization.

Upon construction, fields are initialized to default values. The initialize method must be called to complete initialization.

To construct this object, call PaintSystem::instantiateAllComputedComponents.

Member Function Documentation

◆ inheritAttributesFrom()

void donner::svg::components::ComputedGradientComponent::inheritAttributesFrom ( EntityHandle handle,
EntityHandle base )

Resolve unspecified attributes to default values or inherit from the given base gradient element.

This method is used to propagate attributes such as x1, y1, cx, cy, r, etc from the base element to the current element.

Parameters
handleCurrent entity handle attached to this component.
baseBase entity handle to inherit from, if any. If no base is specified, unspecified attributes are resolved to default values.

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