diff --git a/src/utils/Mouse.ts b/src/utils/Mouse.ts index 7bc39b7fc..66e7f190a 100644 --- a/src/utils/Mouse.ts +++ b/src/utils/Mouse.ts @@ -49,7 +49,8 @@ export function getCoords(event: {pageX: number, pageY: number}, element: HTMLEl } // Convert to cols/rows. - coords[0] = Math.ceil((coords[0] + (isSelection ? charMeasure.width / 2 : 0)) / charMeasure.width); + const flooredCharWidth = Math.floor(charMeasure.width); + coords[0] = Math.ceil((coords[0] + (isSelection ? flooredCharWidth / 2 : 0)) / flooredCharWidth); coords[1] = Math.ceil(coords[1] / Math.ceil(charMeasure.height * lineHeight)); // Ensure coordinates are within the terminal viewport.