pub struct Geometry {
pub view: ViewBox,
pub paths: Vec<SubPath>,
}Expand description
A custom shape’s outline.
Fields§
§view: ViewBoxThe space the points are in.
paths: Vec<SubPath>The strokes, in the order they are drawn.
Implementations§
Source§impl Geometry
impl Geometry
Sourcepub fn read_path(path: &Element) -> Option<Self>
pub fn read_path(path: &Element) -> Option<Self>
Read a draw:path element, whose outline is SVG path data in svg:d.
None where it states no path or no coordinate space.
Arcs are drawn as the straight line to where they end. A and a
occur in none of the 352 paths across the presentation templates
LibreOffice ships, and turning an endpoint-parameterised elliptical arc
into a centre and a sweep is a page of trigonometry to serve nothing that
exists. A line keeps the outline closed and roughly where it belongs,
which is the failure worth having.
Sourcepub fn refit(&mut self)
pub fn refit(&mut self)
Refit the view box to the outline inside it.
A draw:connector is the shape that needs this. Its route is written in
the page’s own coordinates while the svg:viewBox beside it states an
origin of zero, so the two do not agree and the declared box places the
points nowhere near the shape. The outline’s own bounding box does place
them, and for a shape whose box was already right it says the same thing.
An outline with no width or no height keeps a box one unit across, so that a straight horizontal connector divides by something.