chiark / gitweb /
ui: Improve a comment and make it a doc comment
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Apr 2022 23:12:43 +0000 (00:12 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Apr 2022 23:21:19 +0000 (00:21 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/ui.rs

index 9fdd951d17a171a83433e013046f668adf170833..a668f61f67ee13c981cae0c5be0caa622c4111b6 100644 (file)
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -23,11 +23,13 @@ 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)
-// by this, and add it to the SVG y coordinate (ie, shufting the text
-// down).
+/// Fudge factor
+///
+/// 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)
+/// by this, and add it to the SVG y coordinate (ie, shufting the text
+/// down).
 pub const SVG_FONT_Y_ADJUST_OF_FONT_SIZE: f64 = 0.35;
 
 pub fn default_edge_width() -> f64 { DEFAULT_EDGE_WIDTH }