Skip to content
  • George Nachman's avatar
    Add support for underlining in Metal. It's freaking complicated. If a cell is... · a6da3898
    George Nachman authored
    Add support for underlining in Metal. It's freaking complicated. If a cell is underlined, the underline only gets drawn where there is no text, nor any text in adjacent pixels. In the text drawing fragment shader, we already did an early exit for pixels that didn't have text. At that point we check if the cell is underlined. If it is, we sample the neighbors of the texture to see if they are also all not-text-colored. If so, we calculate how much of the region that should have an underline intersects the fragment's pixel: this is the weight. We return the color of the underline weighted so it blends with the background if it should occupy less than one pixel.
    a6da3898