From: Ian Jackson Date: Fri, 15 Apr 2022 19:36:08 +0000 (+0100) Subject: Provide select stroke width to Rust X-Git-Tag: otter-1.1.0~555 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=28d9a3da018b3cd576f0ce4230628fdda9b07c7d;p=otter.git Provide select stroke width to Rust We now have this in two places which is a bit poor, but I don't fancy plumbing it into the ts machinery. Signed-off-by: Ian Jackson --- diff --git a/src/pieces.rs b/src/pieces.rs index 33263627..0d1a8df0 100644 --- a/src/pieces.rs +++ b/src/pieces.rs @@ -24,6 +24,10 @@ pub type SimpleShape = GenericSimpleShape; pub const SELECT_SCALE: f64 = 1.1; +// also in script.ts:redisplay_ancillaries ("halo") +// nelem.setAttributeNS(null,'stroke-width','2px'); +pub const SELECT_STROKE_WIDTH: f64 = 2.0; + pub const DEFAULT_EDGE_WIDTH: f64 = 0.2; pub const INVISIBLE_EDGE_SENSITIVE: f64 = 2.; diff --git a/templates/script.ts b/templates/script.ts index 7adf41d4..024c42a4 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -1242,6 +1242,7 @@ function redisplay_ancillaries(piece: PieceId, p: PieceInfo) { if (halo_colour != null) { let nelem = ancillary_node(piece, halo_colour); if (p.held != null) { + // value 2ps is also in src/pieces.rs SELECT_STROKE_WIDTH nelem.setAttributeNS(null,'stroke-width','2px'); } p.pelem.prepend(nelem);