chiark / gitweb /
docs: wip document shapelibs, move from shapelib-toml
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 23 May 2021 00:56:22 +0000 (01:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 23 May 2021 00:56:22 +0000 (01:56 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
docs/shapelibs.rst
src/shapelib-toml.rs

index 3d4a9f507a2837c0ab964aa5c318a8d82fc49de3..8c29a91d9fc7a350e2d46c05e784ac571a25032e 100644 (file)
@@ -179,16 +179,6 @@ Parameters
    ``_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.
-
- * ``centre`` [2-element array].  The centre of the image, measured
-   from the top left in the image's own internal units.  If not
-   supplied, calculated from the size.
-
  * ``flip`` [boolean, default: false].  Whether this piece can "flip".
    If true, the piece will have two faces, one of which is a mirror
    image of the other.  The default face will be un-reflected version;
@@ -203,3 +193,18 @@ Parameters
    ``files`` entry, and a 2nd face looking like ``back``.  If you want
    to make the piece be occultable, you must also specify
    ``occulted``.  ``back`` is not compatible with ``flip``.
+
+ * ``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.
+
+ * ``centre`` [2-element array].  The centre of the image, measured
+   from the top left in the image's own internal units.  If not
+   supplied, calculated from the size.
+
+ * ``scale``: [number, default=1].  Scale the image by a factor (in
+   both x and y).  ``size`` and ``centre`` are in the image file's
+   own internal coordinate system, not the Otter scaled coordinates
+   which result from multiplying by by this scale factor.
index 3759e972dec585c6118c8e60ac8852e1920e2867..9641625f73e7964efc40b756e32184f75d67dc89 100644 (file)
@@ -26,13 +26,7 @@ pub struct GroupDetails {
   #[serde(default)] pub centre: Option<[f64; 2]>,
   #[serde(default)] pub flip: bool,
   #[serde(default)] pub back: Option<Box <dyn PieceSpec>>,
-
-  /// `size` and `centre` are in the SVG's own internal coordinate
-  /// system, not the Otter scaled coordinates which result from
-  /// multiplying by by this scale factor.
-  /// If not specified, default is `1.0`.
-  #[serde(default="num_traits::identities::One::one")]
-  pub scale: f64,
+  #[serde(default="num_traits::identities::One::one")] pub scale: f64,
 
   /// If specified and non-empty, specifies that this group should be
   /// instantiated multiple times, each time with a recolouring.