зеркало из https://github.com/mozilla/gecko-dev.git
Bug 520872: Make zooming transition better [r=mark.finkle]
This commit is contained in:
Родитель
2a9176c010
Коммит
738beba85b
|
@ -343,5 +343,14 @@ Rect.prototype = {
|
|||
this.right = f.call(this, this.right);
|
||||
this.bottom = f.call(this, this.bottom);
|
||||
return this;
|
||||
},
|
||||
|
||||
/** 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 ? this.right - other.right : 0));
|
||||
let offsetY = (this.top < other.top ? other.top - this.top :
|
||||
(this.bottom > other.bottom ? this.bottom - other.bottom : 0));
|
||||
return this.translate(offsetX, offsetY);
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче