partially revert ligature cursor fix

refs: #478
This commit is contained in:
Wez Furlong committed 2021-10-05 19:46:36 -07:00
1 parent f3159b6689
commit 87ea33f2f8
2 files changed
+21 -17

No files matched your search

-1
View File
@@ -55,7 +55,6 @@ As features stabilize some brief notes about them will accumulate here.
* Fixed: wezterm can now match bitmap fonts that are spread across multiple font files [#1189](https://github.com/wez/wezterm/issues/1189)
* Improved: [use_cap_height_to_scale_fallback_fonts](config/lua/config/use_cap_height_to_scale_fallback_fonts.md) now computes *cap-height* based on the rasterized glyph bitmap which means that the data is accurate in more cases, including for bitmap fonts. Scaling is now also applied across varying text styles; previously it only applied to a font within an `wezterm.font_with_fallback` font list.
* Fixed: ssh config parser incorrectly split `Host` patterns with commas instead of whitespace [#1196](https://github.com/wez/wezterm/issues/1196)
* Fixed: incorrect foreground color when cursor is over parts of a ligatured glyph [#478](https://github.com/wez/wezterm/issues/478)
### 20210814-124438-54e29167
+21 -16
View File
@@ -1652,6 +1652,26 @@ impl super::TermWindow {
for info in glyph_info.iter() {
let glyph = &info.glyph;
let probably_a_ligature = false;
/*
glyph
.texture
.as_ref()
.map(|t| {
let width = self.render_metrics.cell_size.width as f32;
if t.coords.size.width as f32 > width * 1.5 {
// Glyph is wider than the cell
true
} else if (glyph.bearing_x.get() as f32) < (width / -4.) {
// Has excessive negative bearing
true
} else {
false
}
})
.unwrap_or(false);
*/
let top = cell_height
+ (metrics
.map(|m| m.descender)
@@ -1698,22 +1718,7 @@ impl super::TermWindow {
cursor_bg: params.cursor_bg,
cursor_border_color: params.cursor_border_color,
pane: params.pane,
probably_a_ligature: glyph
.texture
.as_ref()
.map(|t| {
let width = self.render_metrics.cell_size.width as f32;
if t.coords.size.width as f32 > width * 1.5 {
// Glyph is wider than the cell
true
} else if (glyph.bearing_x.get() as f32) < (width / -4.) {
// Has excessive negative bearing
true
} else {
false
}
})
.unwrap_or(false),
probably_a_ligature,
});
let pos_x = (self.dimensions.pixel_width as f32 / -2.)