]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Fix incorrect mouse position
authorAnton Skshidlevsky <meefik@gmail.com>
Wed, 17 Aug 2016 07:38:12 +0000 (10:38 +0300)
committerGitHub <noreply@github.com>
Wed, 17 Aug 2016 07:38:12 +0000 (10:38 +0300)
Incorrect mouse position in Midnight Commander

src/xterm.js

index d2e46074ac47593c364879d24b6883e0b60712b7..a0c908a92c1dda8924a66ac582c24af74fea4e35 100644 (file)
         // convert to cols/rows
         w = self.element.clientWidth;
         h = self.element.clientHeight;
-        x = Math.round((x / w) * self.cols);
-        y = Math.round((y / h) * self.rows);
+        x = Math.ceil((x / w) * self.cols);
+        y = Math.ceil((y / h) * self.rows);
 
         // be sure to avoid sending
         // bad positions to the program