From: Ian Jackson Date: Sun, 17 Apr 2022 22:34:24 +0000 (+0100) Subject: ui.rs: Bring another constants together here X-Git-Tag: otter-1.1.0~499 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ed3b033706692faab20f0ce5cf214993515bdb79;p=otter.git ui.rs: Bring another constants together here Signed-off-by: Ian Jackson --- 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)