mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-11-03 21:08:23 +00:00
Temp fix until mouse getCoords PR merged
This commit is contained in:
parent
e63fdf580b
commit
a5c48c891e
24
src/xterm.js
24
src/xterm.js
@ -801,9 +801,19 @@ Terminal.prototype.bindMouse = function() {
|
||||
button = getButton(ev);
|
||||
|
||||
// get mouse coordinates
|
||||
pos = Mouse.getCoords(ev, this.rowContainer, this.charMeasure);
|
||||
pos = Mouse.getCoords(ev, self.rowContainer, self.charMeasure);
|
||||
if (!pos) return;
|
||||
|
||||
// Temp fix until getcoords PR is pushed
|
||||
pos.x = pos[0];
|
||||
pos.y = pos[1];
|
||||
if (pos.x < 0) pos.x = 0;
|
||||
if (pos.x > self.cols) pos.x = self.cols;
|
||||
if (pos.y < 0) pos.y = 0;
|
||||
if (pos.y > self.rows) pos.y = self.rows;
|
||||
pos.x += 32;
|
||||
pos.y += 32;
|
||||
|
||||
sendEvent(button, pos);
|
||||
|
||||
switch (ev.overrideType || ev.type) {
|
||||
@ -829,9 +839,19 @@ Terminal.prototype.bindMouse = function() {
|
||||
var button = pressed
|
||||
, pos;
|
||||
|
||||
pos = Mouse.getCoords(ev, this.rowContainer, this.charMeasure);
|
||||
pos = Mouse.getCoords(ev, self.rowContainer, self.charMeasure);
|
||||
if (!pos) return;
|
||||
|
||||
// Temp fix until getcoords PR is pushed
|
||||
pos.x = pos[0];
|
||||
pos.y = pos[1];
|
||||
if (pos.x < 0) pos.x = 0;
|
||||
if (pos.x > self.cols) pos.x = self.cols;
|
||||
if (pos.y < 0) pos.y = 0;
|
||||
if (pos.y > self.rows) pos.y = self.rows;
|
||||
pos.x += 32;
|
||||
pos.y += 32;
|
||||
|
||||
// buttons marked as motions
|
||||
// are incremented by 32
|
||||
button += 32;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user