Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
SizedElementComponent.h File Reference
#include <optional>
#include <tuple>
#include "donner/base/Box.h"
#include "donner/base/Length.h"
#include "donner/svg/properties/Property.h"
Include dependency graph for SizedElementComponent.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::svg::components::SizedElementProperties
 Stores an offset/size for elements that are positioned with x/y/width/height attributes with respect to their parent. More...
struct  donner::svg::components::SizedElementComponent
 Stores the properties of a sized element, x, y, width, height. More...
struct  donner::svg::components::ComputedSizedElementComponent
 Stores the computed bounds of a sized element, resolving units and percentages. More...
struct  donner::svg::components::ComputedShadowSizedElementComponent
 Stores a shadow tree's computed SizedElementComponent, where a "&lt;use&gt;" element overrides the width or height on "&lt;symbol&gt;" or "<svg>" which use SizedElementComponent. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
namespace  donner::svg
 Donner SVG library, which can load, manipulate and render SVG files.
namespace  donner::svg::components
 Contains the implementation of the Donner ECS,.

Class Documentation

◆ donner::svg::components::SizedElementComponent

struct donner::svg::components::SizedElementComponent

Stores the properties of a sized element, x, y, width, height.

Used for "<svg>", "&lt;image&gt;" and <foreignObject> by the standard, and also internally with "&lt;use&gt;" for Donner.

Collaboration diagram for donner::svg::components::SizedElementComponent:
[legend]
Class Members
bool applyTranslationForUseElement = false Set to true for "&lt;use&gt;" elements, so that x/y are applied as a translation.
bool canOverrideWidthHeightForSymbol = false Set to true for "&lt;symbol&gt;" elements, so that width/height are inherited from the "&lt;use&gt;" element.
SizedElementProperties properties The properties of the sized element, x, y, width, height.

◆ donner::svg::components::ComputedSizedElementComponent

struct donner::svg::components::ComputedSizedElementComponent

Stores the computed bounds of a sized element, resolving units and percentages.

Contains the computed rect and inherited viewBox of the parent element.

Collaboration diagram for donner::svg::components::ComputedSizedElementComponent:
[legend]
Class Members
Box2d bounds The computed rect of this sized element.
Box2d inheritedViewBox The viewBox of the parent element, used for preserveAspectRatio transformations.

◆ donner::svg::components::ComputedShadowSizedElementComponent

struct donner::svg::components::ComputedShadowSizedElementComponent

Stores a shadow tree's computed SizedElementComponent, where a "&lt;use&gt;" element overrides the width or height on "&lt;symbol&gt;" or "<svg>" which use SizedElementComponent.

From https://www.w3.org/TR/SVG2/struct.html#UseElement:

The width and height attributes only have an effect if the referenced element defines a viewport (i.e., if it is a 'svg' or 'symbol'); if so, a value other than auto for the 'use' element overrides the value of the corresponding geometric property on that element.

Collaboration diagram for donner::svg::components::ComputedShadowSizedElementComponent:
[legend]
Class Members
Box2d bounds The computed rect of this sized element.