chiark / gitweb /
Provide select stroke width to Rust
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 15 Apr 2022 19:36:08 +0000 (20:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 15 Apr 2022 21:43:43 +0000 (22:43 +0100)
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 <ijackson@chiark.greenend.org.uk>
src/pieces.rs
templates/script.ts

index 33263627d9c30505264aa1a2b856542179bdd440..0d1a8df0fdcad49138d9693ef5da26ba88489b77 100644 (file)
@@ -24,6 +24,10 @@ pub type SimpleShape = GenericSimpleShape<Html, Outline>;
 
 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.;
 
index 7adf41d45929bdc9ec074c0551812a8930573b03..024c42a46dbe4071e791e98e78dddd95efbce1a6 100644 (file)
@@ -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);