From: Ian Jackson Date: Sun, 23 May 2021 00:37:50 +0000 (+0100) Subject: docs: wip document shapelibs, move from shapelib-toml X-Git-Tag: otter-0.6.0~39 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=0bd1adb36204d926527b9dbea1f6e354b6fdbe90;p=otter.git docs: wip document shapelibs, move from shapelib-toml Signed-off-by: Ian Jackson --- diff --git a/docs/shapelibs.rst b/docs/shapelibs.rst index 47bad98b..b3e43cc9 100644 --- a/docs/shapelibs.rst +++ b/docs/shapelibs.rst @@ -178,3 +178,9 @@ Parameters If both are specified, the group parameter is used as a template. ``_s`` is replaced by the sort extra field from the ``files`` list ``_c`` is replaced by the colour, if applicable. + + * ``orig_size`` (1- or 2-element array, or (default) empty array): If + non-empty, the supplied image is first scaled from ``orig_size`` + to ``size``. If both ``size`` and ```orig_size`` are 2 elements, + this can scale by different amounts in x and y, distorting the + image. diff --git a/src/shapelib-toml.rs b/src/shapelib-toml.rs index 123fd837..89d581e9 100644 --- a/src/shapelib-toml.rs +++ b/src/shapelib-toml.rs @@ -22,12 +22,7 @@ pub struct GroupDefn { pub struct GroupDetails { #[cfg(doc)]inherit: String, // handled specially pub size: Vec, // scaled when put into GroupData - - #[serde(default)] - /// If specified, the input is first scaled from `orig_size` to - /// `size`. If both `size` and `orig_size` are 2 elements, may - /// scale by different amounts in x and y. - pub orig_size: Vec, + #[serde(default)] pub orig_size: Vec, #[serde(default)] /// Default if not supplied is the centre according to the size.