зеркало из https://github.com/mozilla/pjs.git
Bug 624451 Toolkit update to Geometry.jsm r=Mossop a=blocking-fennec
This commit is contained in:
Родитель
c52dd973be
Коммит
1910e1023c
|
@ -299,10 +299,10 @@ Rect.prototype = {
|
|||
|
||||
/** Ensure this rectangle is inside the other, if possible. Preserves w, h. */
|
||||
translateInside: function translateInside(other) {
|
||||
let offsetX = (this.left < other.left ? other.left - this.left :
|
||||
(this.right > other.right ? other.right - this.right : 0));
|
||||
let offsetY = (this.top < other.top ? other.top - this.top :
|
||||
(this.bottom > other.bottom ? other.bottom - this.bottom : 0));
|
||||
let offsetX = (this.left <= other.left ? other.left - this.left :
|
||||
(this.right > other.right ? other.right - this.right : 0));
|
||||
let offsetY = (this.top <= other.top ? other.top - this.top :
|
||||
(this.bottom > other.bottom ? other.bottom - this.bottom : 0));
|
||||
return this.translate(offsetX, offsetY);
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче