From ed3b033706692faab20f0ce5cf214993515bdb79 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 17 Apr 2022 23:34:24 +0100 Subject: [PATCH] ui.rs: Bring another constants together here Signed-off-by: Ian Jackson --- src/pieces.rs | 2 +- src/ui.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pieces.rs b/src/pieces.rs index 56e3dc74..0d88c2df 100644 --- a/src/pieces.rs +++ b/src/pieces.rs @@ -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 { diff --git a/src/ui.rs b/src/ui.rs index 7f2a6a8d..9fdd951d 100644 --- 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) -- 2.30.2