This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

🚸 Make SVG output deterministic

With:

1. Sequential object IDs for Layer#add_anon
2. ID-sorted objects when adding to a layer's <g>

+5 -4
+1 -3
src/graphics/layer.rs
··· 1 - use nanoid::nanoid; 2 - 3 1 use crate::{ColoredObject, Fill, Filter, ObjectSizes, Region, Toggleable}; 4 2 use std::{collections::HashMap, fmt::Display}; 5 3 ··· 100 98 } 101 99 102 100 pub fn add_anon(&mut self, object: impl Into<ColoredObject>) { 103 - self.add(nanoid!(), object); 101 + self.add(format!("anon-{}", self.objects.len()), object); 104 102 } 105 103 106 104 pub fn set(&mut self, name: impl Display, object: impl Into<ColoredObject>) {
+4 -1
src/rendering/layer.rs
··· 1 + use itertools::Itertools; 1 2 use measure_time::debug_time; 2 3 3 4 use super::renderable::SVGRenderable; ··· 16 17 .set("class", "layer") 17 18 .set("data-layer", self.name.clone()); 18 19 19 - for (object_id, obj) in &self.objects { 20 + for (object_id, obj) in 21 + self.objects.iter().sorted_by_key(|(oid, _)| (*oid).clone()) 22 + { 20 23 layer_group = layer_group.add(obj.render_to_svg( 21 24 colormap.clone(), 22 25 cell_size,