Improve box styling

main
Elnu 1 year ago
parent 4b61aef177
commit 78aae3de62

@ -54,7 +54,7 @@ fn main() -> Result<(), Error> {
}; };
let box_size = SVGMeasure::new(14.0, SVGUnit::Millimeter); let box_size = SVGMeasure::new(14.0, SVGUnit::Millimeter);
let boxes = 54; let boxes = 54;
let padding = SVGMeasure::new(5.0, SVGUnit::Millimeter); let padding = SVGMeasure::new(2.5, SVGUnit::Millimeter);
let document = DocumentTemplate { let document = DocumentTemplate {
positions: positions(box_size, padding, &dimensions, boxes), positions: positions(box_size, padding, &dimensions, boxes),
dimensions, dimensions,

@ -1,8 +1,7 @@
<svg version="1.1" <svg version="1.1"
width="{{ dimensions.width }}" height="{{ dimensions.height }}" width="{{ dimensions.width }}" height="{{ dimensions.height }}"
xmlns="http://www.w3.org/2000/svg"> xmlns="http://www.w3.org/2000/svg">
<rect width="100%" height="100%" fill="gray" />
{% for (x, y) in positions %} {% for (x, y) in positions %}
<rect x="{{ x }}" y="{{ y }}" width="{{ box_size }}" height="{{ box_size }}" fill="white" /> <rect x="{{ x }}" y="{{ y }}" rx="2mm" width="{{ box_size }}" height="{{ box_size }}" fill="none" stroke="#cccccc" stroke-width="1pt" />
{% endfor %} {% endfor %}
</svg> </svg>

Before

Width:  |  Height:  |  Size: 330 B

After

Width:  |  Height:  |  Size: 324 B

Loading…
Cancel
Save