NovaSVG 0.11.5
An SVG library
Loading...
Searching...
No Matches
geometry.h
Go to the documentation of this file.
1#ifndef NOVAVG_GEOMETRY_H
2#define NOVAVG_GEOMETRY_H
3#pragma once
4
5// Box: the axis-aligned bounding box the svg API returns. Nothing here knows SVG.
6
7#include "../config.h"
8
9
10
11#include <stb/outline.hpp> // stb::matrix
12
13namespace nova::vg {
14
19public:
23 box() = default;
24
32 box(float x, float y, float w, float h);
33
39 box& transform(const stb::matrix& matrix);
40
46 box transformed(const stb::matrix& matrix) const;
47
48 float x{0};
49 float y{0};
50 float w{0};
51 float h{0};
52};
53
54
55} // namespace nova::vg
56
57#endif // NOVAVG_GEOMETRY_H
box()=default
Constructs a box with zero dimensions.
box(float x, float y, float w, float h)
Constructs a box with the specified position and size.
box transformed(const stb::matrix &matrix) const
Returns a new box transformed by the specified matrix.
box & transform(const stb::matrix &matrix)
Transforms the box using the specified matrix.
float y
The y-coordinate of the box's origin.
Definition geometry.h:49
float w
The width of the box.
Definition geometry.h:50
float h
The height of the box.
Definition geometry.h:51
float x
The x-coordinate of the box's origin.
Definition geometry.h:48
#define NOVA_API
Definition config.h:29
Definition svg.h:56