    }

    function renderUnderlineDecoration({ rangeStart, rangeEnd, underlineStyle, underlineThickness }) {
      const lineStartX = TEXT_ANCHOR_X + canvasCtx.measureText(editContext.text.substring(0, rangeStart)).width;
      const lineEndX = TEXT_ANCHOR_X + canvasCtx.measureText(editContext.text.substring(0, rangeEnd)).width;
      const lineY = TEXT_ANCHOR_Y + 7; // Some space between the text and the underline.
      const thickWidth = 3;
      const thinWidth = 2;

      canvasCtx.save();
      canva