Projects STRLCPY alacritty Commits d5e9d1d8
🤬
  • ■ ■ ■ ■ ■ ■
    CHANGELOG.md
    skipped 10 lines
    11 11   
    12 12  - Uppercase `-T` short form for `--title`
    13 13   
     14 +### Changed
     15 + 
     16 +- `font.glyph_offset.y` is now applied to underline/strikeout
     17 + 
    14 18  ### Fixed
    15 19   
    16 20  - `--help` output for `--class` does not match man pages
    skipped 1079 lines
  • ■ ■ ■ ■ ■
    alacritty/src/display/mod.rs
    skipped 832 lines
    833 833   );
    834 834   }
    835 835   
    836  - let mut rects = lines.rects(&metrics, &size_info);
     836 + let mut rects = lines.rects(&metrics, &size_info, config.font.glyph_offset);
    837 837   
    838 838   if let Some(vi_cursor_point) = vi_cursor_point {
    839 839   // Indicate vi mode by showing the cursor's position in the top right corner.
    skipped 271 lines
    1111 1111   
    1112 1112   // Add underline for preedit text.
    1113 1113   let underline = RenderLine { start, end, color: fg };
    1114  - rects.extend(underline.rects(Flags::UNDERLINE, &metrics, &self.size_info));
     1114 + rects.extend(underline.rects(
     1115 + Flags::UNDERLINE,
     1116 + &metrics,
     1117 + &self.size_info,
     1118 + config.font.glyph_offset,
     1119 + ));
    1115 1120   
    1116 1121   let ime_popup_point = match preedit.cursor_end_offset {
    1117 1122   Some(cursor_end_offset) if cursor_end_offset != 0 => {
    skipped 446 lines
  • ■ ■ ■ ■ ■
    alacritty/src/renderer/rects.rs
    skipped 7 lines
    8 8  use alacritty_terminal::term::cell::Flags;
    9 9  use alacritty_terminal::term::color::Rgb;
    10 10   
     11 +use crate::config::ui_config::Delta;
    11 12  use crate::display::content::RenderableCell;
    12 13  use crate::display::SizeInfo;
    13 14  use crate::gl;
    skipped 37 lines
    51 52  }
    52 53   
    53 54  impl RenderLine {
    54  - pub fn rects(&self, flag: Flags, metrics: &Metrics, size: &SizeInfo) -> Vec<RenderRect> {
     55 + pub fn rects(
     56 + &self,
     57 + flag: Flags,
     58 + metrics: &Metrics,
     59 + size: &SizeInfo,
     60 + offset: Delta<i8>,
     61 + ) -> Vec<RenderRect> {
    55 62   let mut rects = Vec::new();
    56 63   
    57 64   let mut start = self.start;
    58 65   while start.line < self.end.line {
    59 66   let end = Point::new(start.line, size.last_column());
    60  - Self::push_rects(&mut rects, metrics, size, flag, start, end, self.color);
     67 + Self::push_rects(&mut rects, metrics, size, offset, flag, start, end, self.color);
    61 68   start = Point::new(start.line + 1, Column(0));
    62 69   }
    63  - Self::push_rects(&mut rects, metrics, size, flag, start, self.end, self.color);
     70 + Self::push_rects(&mut rects, metrics, size, offset, flag, start, self.end, self.color);
    64 71   
    65 72   rects
    66 73   }
    67 74   
    68 75   /// Push all rects required to draw the cell's line.
     76 + #[allow(clippy::too_many_arguments)]
    69 77   fn push_rects(
    70 78   rects: &mut Vec<RenderRect>,
    71 79   metrics: &Metrics,
    72 80   size: &SizeInfo,
     81 + offset: Delta<i8>,
    73 82   flag: Flags,
    74 83   start: Point<usize>,
    75 84   end: Point<usize>,
    skipped 7 lines
    83 92   
    84 93   rects.push(Self::create_rect(
    85 94   size,
     95 + offset,
    86 96   metrics.descent,
    87 97   start,
    88 98   end,
    skipped 22 lines
    111 121   _ => unimplemented!("Invalid flag for cell line drawing specified"),
    112 122   };
    113 123   
    114  - let mut rect =
    115  - Self::create_rect(size, metrics.descent, start, end, position, thickness, color);
     124 + let mut rect = Self::create_rect(
     125 + size,
     126 + offset,
     127 + metrics.descent,
     128 + start,
     129 + end,
     130 + position,
     131 + thickness,
     132 + color,
     133 + );
    116 134   rect.kind = ty;
    117 135   rects.push(rect);
    118 136   }
    119 137   
    120 138   /// Create a line's rect at a position relative to the baseline.
     139 + #[allow(clippy::too_many_arguments)]
    121 140   fn create_rect(
    122 141   size: &SizeInfo,
     142 + offset: Delta<i8>,
    123 143   descent: f32,
    124 144   start: Point<usize>,
    125 145   end: Point<usize>,
    skipped 11 lines
    137 157   let line_bottom = (start.line as f32 + 1.) * size.cell_height();
    138 158   let baseline = line_bottom + descent;
    139 159   
    140  - let mut y = (baseline - position - thickness / 2.).round();
     160 + let mut y = (baseline - position - offset.y as f32 - thickness / 2.).round();
    141 161   let max_y = line_bottom - thickness;
    142 162   if y > max_y {
    143 163   y = max_y;
    skipped 23 lines
    167 187   }
    168 188   
    169 189   #[inline]
    170  - pub fn rects(&self, metrics: &Metrics, size: &SizeInfo) -> Vec<RenderRect> {
     190 + pub fn rects(&self, metrics: &Metrics, size: &SizeInfo, offset: Delta<i8>) -> Vec<RenderRect> {
    171 191   self.inner
    172 192   .iter()
    173 193   .flat_map(|(flag, lines)| {
    174  - lines.iter().flat_map(move |line| line.rects(*flag, metrics, size))
     194 + lines.iter().flat_map(move |line| line.rects(*flag, metrics, size, offset))
    175 195   })
    176 196   .collect()
    177 197   }
    skipped 310 lines
Please wait...
Page is in error, reload to recover