2#ifndef SEEN_SP_SVG_BOX_H
3#define SEEN_SP_SVG_BOX_H
38 std::string
write()
const;
39 std::string
toString(
const std::string &unit,
const Geom::Scale &doc_scale, std::optional<unsigned int> precision = {},
bool add_unit =
true)
const;
44 void set(
BoxSide side,
double value,
bool confine =
false);
47 void set(
double vert,
double horz) {
set(vert, horz, vert, horz); }
C right() const
Return rightmost coordinate of the rectangle (+X is to the right).
C top() const
Return top coordinate of the rectangle (+Y is downwards).
C left() const
Return leftmost coordinate of the rectangle (+X is to the right).
C bottom() const
Return bottom coordinate of the rectangle (+Y is downwards).
Axis-aligned rectangle that can be empty.
Axis aligned, non-empty rectangle.
SVGBox(Geom::OptRect box)
void set(double vert, double horz)
void set(double top, double horz, double bottom)
static Geom::Dim2 get_scale_axis(BoxSide side)
void set(Geom::OptRect box)
bool fromString(const std::string &value, const std::string &unit, const Geom::Scale &doc_scale)
Set the svg box from user input, with a default unit.
bool isZero() const
Returns true if the box is set, but all values are zero.
void readOrUnset(gchar const *str, const Geom::Scale &doc_scale)
std::string write() const
Write out the values into a compact form.
void update(double em, double ex, double width, double height)
Update box with em, ex and percentage scaling.
SVGBox()
An svg box is a type of css/html type which contains up to 4 svg lengths.
bool read(const std::string &value, const Geom::Scale &doc_scale)
Read in the value, may be an array of four.
std::string toString(const std::string &unit, const Geom::Scale &doc_scale, std::optional< unsigned int > precision={}, bool add_unit=true) const
Write as specific unit for user display.
double get(BoxSide side) const
Dim2
2D axis enumeration (X or Y).