Make underline positioning aware of line_height
This commit is contained in:
parent
ca31dcadd5
commit
9ce55eb511
1 changed files with 10 additions and 6 deletions
|
|
@ -285,14 +285,15 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
if span.underline || is_hovered_link {
|
if span.underline || is_hovered_link {
|
||||||
|
let size = span
|
||||||
|
.size
|
||||||
|
.or(self.size)
|
||||||
|
.unwrap_or(renderer.default_size());
|
||||||
|
|
||||||
let line_height = span
|
let line_height = span
|
||||||
.line_height
|
.line_height
|
||||||
.unwrap_or(self.line_height)
|
.unwrap_or(self.line_height)
|
||||||
.to_absolute(
|
.to_absolute(size);
|
||||||
span.size
|
|
||||||
.or(self.size)
|
|
||||||
.unwrap_or(renderer.default_size()),
|
|
||||||
);
|
|
||||||
|
|
||||||
for bounds in regions {
|
for bounds in regions {
|
||||||
renderer.fill_quad(
|
renderer.fill_quad(
|
||||||
|
|
@ -302,7 +303,10 @@ where
|
||||||
+ translation
|
+ translation
|
||||||
+ Vector::new(
|
+ Vector::new(
|
||||||
0.0,
|
0.0,
|
||||||
line_height.0 * 0.8 + 1.0,
|
size.0
|
||||||
|
+ (line_height.0 - size.0)
|
||||||
|
/ 2.0
|
||||||
|
- size.0 * 0.08,
|
||||||
),
|
),
|
||||||
Size::new(bounds.width, 1.0),
|
Size::new(bounds.width, 1.0),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue