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