chiark / gitweb /
ui.rs: Bring another constants together here
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Apr 2022 22:34:24 +0000 (23:34 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Apr 2022 23:07:39 +0000 (00:07 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/pieces.rs
src/ui.rs

index 56e3dc7459bb7864a69292f4357aa7740dd6d9a0..0d88c2df6231d456d684781ef436b70dd45ac621 100644 (file)
@@ -193,7 +193,7 @@ impl PieceLabelLoaded {
       else if let Some(c) = def_colour { c.borrow() }
       else { Html::lit("black").into() }
     };
-    let fontsz = 4.;
+    let fontsz = LABEL_FONT_SIZE;
     let PosC{ coords: [x,y] } = {
       use piece_specs::PieceLabelPlace::*;
       let inout = match self.place {
index 7f2a6a8dded6d01460f143ef4701079deb2f4bd4..9fdd951d17a171a83433e013046f668adf170833 100644 (file)
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -21,6 +21,8 @@ pub const SELECT_STROKE_WIDTH: f64 = 2.0;
 pub const DEFAULT_EDGE_WIDTH: f64 = 0.2;
 pub const INVISIBLE_EDGE_SENSITIVE: f64 = 2.;
 
+pub const LABEL_FONT_SIZE: f64 = 4.0;
+
 // When trying to centre text, we use text-align and/or text-anchor
 // to do the horizontal positioning, but vertical positioning is
 // troublesome.  We bodge it.  Multiple the font size (in pixels)