mirror of
https://github.com/alacritty/alacritty.git
synced 2025-07-31 22:03:40 -04:00
Increase Beam, Underline and Box cursors' line width
This commit is contained in:
parent
7ecf93ec70
commit
696fc792e8
2 changed files with 3 additions and 2 deletions
|
@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Line selection will now expand across wrapped lines
|
- Line selection will now expand across wrapped lines
|
||||||
- The default value for `draw_bold_text_with_bright_colors` is now `false`
|
- The default value for `draw_bold_text_with_bright_colors` is now `false`
|
||||||
- Mirror OSC query terminators instead of always using BEL
|
- Mirror OSC query terminators instead of always using BEL
|
||||||
|
- Increased Beam, Underline, and Hollow Block cursors' line widths
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ use alacritty_terminal::ansi::CursorStyle;
|
||||||
use font::{BitmapBuffer, Metrics, RasterizedGlyph};
|
use font::{BitmapBuffer, Metrics, RasterizedGlyph};
|
||||||
|
|
||||||
/// Width/Height of the cursor relative to the font width
|
/// Width/Height of the cursor relative to the font width
|
||||||
pub const CURSOR_WIDTH_PERCENTAGE: i32 = 15;
|
pub const CURSOR_WIDTH_PERCENTAGE: f64 = 0.15;
|
||||||
|
|
||||||
pub fn get_cursor_glyph(
|
pub fn get_cursor_glyph(
|
||||||
cursor: CursorStyle,
|
cursor: CursorStyle,
|
||||||
|
@ -33,7 +33,7 @@ pub fn get_cursor_glyph(
|
||||||
// Calculate the cell metrics
|
// Calculate the cell metrics
|
||||||
let height = metrics.line_height as i32 + i32::from(offset_y);
|
let height = metrics.line_height as i32 + i32::from(offset_y);
|
||||||
let mut width = metrics.average_advance as i32 + i32::from(offset_x);
|
let mut width = metrics.average_advance as i32 + i32::from(offset_x);
|
||||||
let line_width = cmp::max(width * CURSOR_WIDTH_PERCENTAGE / 100, 1);
|
let line_width = cmp::max((width as f64 * CURSOR_WIDTH_PERCENTAGE).round() as i32, 1);
|
||||||
|
|
||||||
// Double the cursor width if it's above a double-width glyph
|
// Double the cursor width if it's above a double-width glyph
|
||||||
if is_wide {
|
if is_wide {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue