Bug 458447: use whole pixels to position canvas, r=mfinkle

This commit is contained in:
Gavin Sharp 2008-10-06 15:18:55 -04:00
Родитель b8838a48a9
Коммит 365fc53218
2 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@ -82,12 +82,13 @@ var BrowserUI = {
_faviconAdded : false,
_setContentPosition : function (aProp, aValue) {
let value = Math.round(aValue);
if (aProp == "left") {
gContentBox.style.marginLeft = aValue + "px";
gContentBox.style.marginRight = -aValue + "px";
gContentBox.style.marginLeft = value + "px";
gContentBox.style.marginRight = -value + "px";
} else if (aProp == "top") {
gContentBox.style.marginTop = aValue + "px";
gContentBox.style.marginBottom = -aValue + "px";
gContentBox.style.marginTop = value + "px";
gContentBox.style.marginBottom = -value + "px";
}
},
get _contentTop() {

Просмотреть файл

@ -609,10 +609,13 @@
<method name="_updateCanvasPosition">
<body><![CDATA[
this._canvas.style.marginLeft = this.dragData.dragX + "px";
this._canvas.style.marginRight = -this.dragData.dragX + "px";
this._canvas.style.marginTop = this.dragData.dragY + "px";
this._canvas.style.marginBottom = -this.dragData.dragY + "px";
let x = Math.round(this.dragData.dragX);
let y = Math.round(this.dragData.dragY);
this._canvas.style.marginLeft = x + "px";
this._canvas.style.marginRight = -x + "px";
this._canvas.style.marginTop = y + "px";
this._canvas.style.marginBottom = -y + "px";
// Force a sync redraw
window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)