Merge pull request #556 from Tyriar/555_fix_mouse_coords

Use CharMeasure to determine mouse coordinates
This commit is contained in:
Daniel Imms
2017-02-20 03:17:50 -08:00
committed by GitHub
+2 -4
View File
@@ -963,10 +963,8 @@ Terminal.prototype.bindMouse = function() {
}
// convert to cols/rows
w = self.element.clientWidth;
h = self.element.clientHeight;
x = Math.ceil((x / w) * self.cols);
y = Math.ceil((y / h) * self.rows);
x = Math.ceil(x / self.charMeasure.width);
y = Math.ceil(y / self.charMeasure.height);
// be sure to avoid sending
// bad positions to the program