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

Stores an offset/size for elements that are positioned with x/y/width/height attributes with respect to their parent. More...

#include "donner/svg/components/layout/SizedElementComponent.h"

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

Public Member Functions

auto allProperties ()
 Get all properties as a tuple.
 

Public Attributes

Property< Lengthdx
 The x-coordinate of the element, defaults to 0.
 
Property< Lengthdy
 The y-coordinate of the element, defaults to 0.
 
Property< Lengthdwidth {"width", []() -> std::optional<Lengthd> { return std::nullopt; }}
 The width of the element, defaults to none.
 
Property< Lengthdheight {"height", []() -> std::optional<Lengthd> { return std::nullopt; }}
 The height of the element, defaults to none.
 

Detailed Description

Stores an offset/size for elements that are positioned with x/y/width/height attributes with respect to their parent.

Used for "<svg>", "<image>" and xml_foreignObject by the standard, and also internally with "<use>" for Donner.

If not specified, x/y default to 0, and width/height are std::nullopt.

Member Data Documentation

◆ x

Property<Lengthd> donner::svg::components::SizedElementProperties::x
Initial value:
{"x",
[]() -> std::optional<Lengthd> { return Lengthd(0, Lengthd::Unit::None); }}
Length< double > Lengthd
Shorthand for Length<double>.
Definition Length.h:222

The x-coordinate of the element, defaults to 0.

◆ y

Property<Lengthd> donner::svg::components::SizedElementProperties::y
Initial value:
{"y",
[]() -> std::optional<Lengthd> { return Lengthd(0, Lengthd::Unit::None); }}

The y-coordinate of the element, defaults to 0.


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