From: Ian Jackson Date: Fri, 15 Apr 2022 19:34:49 +0000 (+0100) Subject: Provide cooldown timer stroke width to Rust X-Git-Tag: otter-1.1.0~554 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=574c8b8b0fc56fe3a3f2d91022896d1195c8f253;p=otter.git Provide cooldown timer stroke width to Rust We now have this in two places which is a bit poor, but we already have some duplication between die.svg and the Rust code - eg, the path generation which was just c&p. I have left a comment. And arranged to filter it out for distribution. Signed-off-by: Ian Jackson --- diff --git a/dice/cooldown-template-extractor b/dice/cooldown-template-extractor index d1051a29..2179a1e1 100755 --- a/dice/cooldown-template-extractor +++ b/dice/cooldown-template-extractor @@ -39,6 +39,9 @@ sub filter_element ($@) { next if $keep_attr{$name}; $node->removeAttribute($name); } + foreach my $desc_node ($node->getChildrenByTagName('desc')) { + $node->removeChild($desc_node); + } } sub filter_circle () { my @xy = qw(cx cy); diff --git a/dice/die.svg b/dice/die.svg index 696c9ba3..ab15808a 100644 --- a/dice/die.svg +++ b/dice/die.svg @@ -80,7 +80,11 @@ cx="0" cy="0" r="8" - inkscape:label="timeblack" /> + inkscape:label="timeblack"> + OUTER BLACK LINE FOR COOLDOWN TIMER +NOTE - CHANGING STROKE WITH - EDIT src/dice.rs COOLDOWN_STROKE_WIDTH + Duration { Duration::from_millis(4000) } fn default_circle_scale() -> f64 { 1. } +// Copy of the value from die.svg's "timeblack"'s stroke-width +const COOLDOWN_STROKE_WIDTH: f64 = 1.512; + const COOLDOWN_EXTRA_RADIUS: f64 = DEFAULT_EDGE_WIDTH * 2. + 0.2; #[derive(Debug,Serialize,Deserialize)]