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

Parameters for a "<ellipse>" element. More...

#include "donner/svg/components/shape/EllipseComponent.h"

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

Public Member Functions

auto allProperties ()
 Get all properties as a tuple.
 
std::tuple< Lengthd, double > calculateRx (const Boxd &viewbox, const FontMetrics &fontMetrics) const
 Calculate the actual value of rx in pixels, taking into account the viewbox and handling "auto".
 
std::tuple< Lengthd, double > calculateRy (const Boxd &viewbox, const FontMetrics &fontMetrics) const
 Calculate the actual value of ry in pixels, taking into account the viewbox and handling "auto".
 

Public Attributes

Property< Lengthdcx
 The center x-coordinate of the ellipse, defaults to 0.
 
Property< Lengthdcy
 The center y-coordinate of the ellipse, defaults to 0.
 
Property< Lengthdrx {"rx", []() -> std::optional<Lengthd> { return std::nullopt; }}
 The x-radius of the ellipse, defaults to 0.
 
Property< Lengthdry {"ry", []() -> std::optional<Lengthd> { return std::nullopt; }}
 The y-radius of the ellipse, defaults to 0.
 

Detailed Description

Parameters for a "<ellipse>" element.

Member Function Documentation

◆ calculateRx()

std::tuple< Lengthd, double > donner::svg::components::EllipseProperties::calculateRx ( const Boxd & viewbox,
const FontMetrics & fontMetrics ) const
inline

Calculate the actual value of rx in pixels, taking into account the viewbox and handling "auto".

Parameters
viewboxThe viewbox of the SVG document.
fontMetricsThe font metrics of the SVG document.
Returns
The actual value of rx in pixels.

◆ calculateRy()

std::tuple< Lengthd, double > donner::svg::components::EllipseProperties::calculateRy ( const Boxd & viewbox,
const FontMetrics & fontMetrics ) const
inline

Calculate the actual value of ry in pixels, taking into account the viewbox and handling "auto".

Parameters
viewboxThe viewbox of the SVG document.
fontMetricsThe font metrics of the SVG document.
Returns
The actual value of ry in pixels.

Member Data Documentation

◆ cx

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

The center x-coordinate of the ellipse, defaults to 0.

◆ cy

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

The center y-coordinate of the ellipse, defaults to 0.


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