Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
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 <use> element overrides the width or height on <symbol> 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>, <image> and <foreignObject> by the standard, and also internally with <use> for Donner.

Class Members
bool applyTranslationForUseElement = false Set to true for <use> elements, so that x/y are applied as a translation.
bool canOverrideWidthHeightForSymbol = false Set to true for <symbol> elements, so that width/height are inherited from the <use> 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.

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 <use> element overrides the width or height on <symbol> 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.

Class Members
Box2d bounds The computed rect of this sized element.