pub struct CanvasOverlay {
pub w: f64,
pub h: f64,
pub origin: [f64; 2],
pub rescale: f64,
}Expand description
The page frame of the SVG render_svg draws (issue #19): what
maps a point of the compiled drawing — PinOverlay::x/y, in
pic inches with y up — to SVG user units (the root viewBox
space, 96 per inch, y down). Exactly:
sx = (x + origin[0]) · 96
sy = (h − (y + origin[1])) · 96(Self::to_svg). This is rpic’s own frame — the canvas of its
scene export (origin is where the pic origin sits, measured from
the page’s lower-left corner; w/h the page size in inches,
margins and stroke padding included, so the viewBox is 0 0 w·96 h·96), computed here at full precision instead of the scene’s six
decimals. Note the signs (+ origin) and that rescale does not
enter: the drawing’s coordinates, pins included, are already past
the whole-picture rescale.
Fields§
§w: f64Page width and height in inches (viewBox = 0 0 w·96 h·96).
h: f64§origin: [f64; 2]The pic origin, in inches from the page’s lower-left corner.
rescale: f64The whole-picture rescale factor (.PS <width>, maxpswid,
maxpsht; 1 when none) — informational: the shapes and pins
already carry it.