Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Procrat committed Apr 27, 2023
1 parent e087e9c commit 0b6fd09
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ impl Entry {
let mut style = "position: absolute; white-space: pre; pointer-events: auto;".to_string();
write!(style, "left: {left}px; top: {top}px;").ok();
write!(style, "width: {width}px; height: {height}px;").ok();
// The default line height in browsers is 1.2, which is great for multi-line text and
// elements whose height is greater than the line height. In this case, however, where the
// height and the font size are set to the same value, the default setting of 1.2 pushes
// the text below the allotted space.
write!(style, "line-height: 1").ok();

self.text.set_attribute_or_warn("style", style);
Expand Down

0 comments on commit 0b6fd09

Please sign in to comment.