ctionStart = e.selectionStart;
      selectionEnd = e.selectionEnd;
    });

    function computeCharacterBound(offset) {
      const widthBeforeChar = canvasCtx.measureText(editContext.text.substring(0, offset)).width;
      const charWidth = canvasCtx.measureText(editContext.text[offset]).width;

      const charX = canvas.offsetLeft + TEXT_ANCHOR_X + widthBeforeChar;
      const charY = canvas.offsetTop + TEXT_ANCHOR_Y;

      return DOMRect.fromRect({
        x: charX,
        y: charY - FONT_SIZE,
    