Fix selection horizontal offset

Fixes #1000
This commit is contained in:
Daniel Imms
2017-09-20 11:53:19 +09:00
parent 1f49879298
commit 79c07d436e
+2 -1
View File
@@ -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.