1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-25 10:22:43 +03:00

fix strikethrough position for line_height != 1.0

This commit is contained in:
Wez Furlong 2023-08-26 13:01:41 -07:00
parent b904ed7677
commit 360ad2a3a9
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
3 changed files with 6 additions and 1 deletions

View File

@ -88,6 +88,7 @@ As features stabilize some brief notes about them will accumulate here.
* Charselect and repl recency/history were not persisted across restarts. #4047 ?4019 * Charselect and repl recency/history were not persisted across restarts. #4047 ?4019
* macOS: system font fallback didn't always find a workable fallback font. #4099 #849 * macOS: system font fallback didn't always find a workable fallback font. #4099 #849
* F13-F24 keys are now supported. Thanks to @ovidiu-ionescu! #3937 * F13-F24 keys are now supported. Thanks to @ovidiu-ionescu! #3937
* Strikethrough position was not centered when setting `line_height` #4196
#### Updated #### Updated
* Bundled harfbuzz to 8.1.1 * Bundled harfbuzz to 8.1.1

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
printf "\x1b[58:2::255:0:0m\x1b[4:1msingle\x1b[4:2mdouble\x1b[4:3mcurly\x1b[4:4mdotted\x1b[4:5mdashed\x1b[0m\n" printf "\x1b[58:2::255:0:0m\x1b[4:1msingle\x1b[4:2mdouble\x1b[4:3mcurly\x1b[4:4mdotted\x1b[4:5mdashed\x1b[0m\n"
printf "\x1b[9mStRiKeThRoUgH\x1b[0m\n"
echo echo
printf "\x1b[58:2::0:255:0m\x1b[53moverline\x1b[0m\n" printf "\x1b[58:2::0:255:0m\x1b[53moverline\x1b[0m\n"

View File

@ -111,7 +111,10 @@ impl RenderMetrics {
let descender_plus_two = let descender_plus_two =
(2 * underline_height + descender_row).min(cell_height as isize - underline_height); (2 * underline_height + descender_row).min(cell_height as isize - underline_height);
let strike_row = match &config.strikethrough_position { let strike_row = match &config.strikethrough_position {
None => descender_row / 2, None => {
((cell_height as f64 + (metrics.descender.get() - underline_position)) / 2.)
as isize
}
Some(d) => d Some(d) => d
.evaluate_as_pixels(DimensionContext { .evaluate_as_pixels(DimensionContext {
dpi: fonts.get_dpi() as f32, dpi: fonts.get_dpi() as f32,