Revert "try to use getCoords everywhere."

This reverts commit 92f167eee8.
This commit is contained in:
Christopher Jeffrey 2015-03-29 15:48:07 -07:00
parent 92f167eee8
commit c7a6ce60f8
1 changed files with 22 additions and 28 deletions

View File

@ -6519,8 +6519,7 @@ Listbar.prototype.addItem =
Listbar.prototype.appendItem = function(item, callback) { Listbar.prototype.appendItem = function(item, callback) {
var self = this var self = this
, prev = this.items[this.items.length - 1] , prev = this.items[this.items.length - 1]
, lpos = prev && (prev._getCoords() || { xi: prev.aleft }) , drawn = prev ? prev.aleft + prev.width : 0
, drawn = prev ? lpos.xi + prev.width : 0
, cmd , cmd
, title , title
, len; , len;
@ -6859,12 +6858,10 @@ Terminal.prototype.bootstrap = function() {
this.screen.on('mouse', function(data) { this.screen.on('mouse', function(data) {
if (self.screen.focused !== self) return; if (self.screen.focused !== self) return;
var lpos = self._getCoords() || { xi: self.aleft, yi: self.atop }; if (data.x < self.aleft + self.ileft) return;
if (data.y < self.atop + self.itop) return;
if (data.x < lpos.xi + self.ileft) return; if (data.x > self.aleft - self.ileft + self.width) return;
if (data.y < lpos.yi + self.itop) return; if (data.y > self.atop - self.itop + self.height) return;
if (data.x > lpos.xi - self.ileft + self.width) return;
if (data.y > lpos.yi - self.itop + self.height) return;
if (self.term.x10Mouse if (self.term.x10Mouse
|| self.term.vt200Mouse || self.term.vt200Mouse
@ -6879,8 +6876,8 @@ Terminal.prototype.bootstrap = function() {
} }
var b = data.raw[0] var b = data.raw[0]
, x = data.x - lpos.xi , x = data.x - self.aleft
, y = data.y - lpos.yi , y = data.y - self.atop
, s; , s;
if (self.term.urxvtMouse) { if (self.term.urxvtMouse) {
@ -7220,23 +7217,22 @@ Image.prototype.setImage = function(img, callback) {
: callback(null, success); : callback(null, success);
}); });
var lpos = self._getCoords() || { xi: self.aleft, yi: self.atop } var width = self.width * ratio.tw | 0
, width = self.width * ratio.tw | 0
, height = self.height * ratio.th | 0 , height = self.height * ratio.th | 0
, xi = lpos.xi * ratio.tw | 0 , aleft = self.aleft * ratio.tw | 0
, yi = lpos.yi * ratio.th | 0; , atop = self.atop * ratio.th | 0;
var input = '0;1;' var input = '0;1;'
+ xi + ';' + aleft + ';'
+ yi + ';' + atop + ';'
+ width + ';' + width + ';'
+ height + ';;;;;' + height + ';;;;;'
+ img + img
+ '\n4;\n3;\n'; + '\n4;\n3;\n';
self._props = { self._props = {
xi: xi, aleft: aleft,
yi: yi, atop: atop,
width: width, width: width,
height: height height: height
}; };
@ -7268,15 +7264,13 @@ Image.prototype.setImage = function(img, callback) {
return callback(err); return callback(err);
} }
var lpos = self._getCoords() || { xi: self.aleft, yi: self.atop };
if (self._lastSize if (self._lastSize
&& ratio.tw === self._lastSize.tw && ratio.tw === self._lastSize.tw
&& ratio.th === self._lastSize.th && ratio.th === self._lastSize.th
&& size.width === self._lastSize.width && size.width === self._lastSize.width
&& size.height === self._lastSize.height && size.height === self._lastSize.height
&& lpos.xi === self._lastSize.xi && self.aleft === self._lastSize.aleft
&& lpos.yi === self._lastSize.yi) { && self.atop === self._lastSize.atop) {
if (!callback) return; if (!callback) return;
return callback(null, success); return callback(null, success);
} }
@ -7286,8 +7280,8 @@ Image.prototype.setImage = function(img, callback) {
th: ratio.th, th: ratio.th,
width: size.width, width: size.width,
height: size.height, height: size.height,
xi: lpos.xi, aleft: self.aleft,
yi: lpos.yi atop: self.atop
}; };
self.position.width = size.width / ratio.tw | 0; self.position.width = size.width / ratio.tw | 0;
@ -7336,12 +7330,12 @@ Image.prototype.clearImage = function(callback) {
var width = this._props.width + 2 var width = this._props.width + 2
, height = this._props.height + 2 , height = this._props.height + 2
, xi = this._props.xi , aleft = this._props.aleft
, yi = this._props.yi; , atop = this._props.atop;
var input = '6;' var input = '6;'
+ xi + ';' + aleft + ';'
+ yi + ';' + atop + ';'
+ width + ';' + width + ';'
+ height + height
+ '\n4;\n3;\n'; + '\n4;\n3;\n';