Fix silly mistake in the patch for bug 459170

This commit is contained in:
Gavin Sharp 2008-12-12 23:31:30 -05:00
Родитель 6458fd420c
Коммит 70bb9b52c3
1 изменённых файлов: 11 добавлений и 7 удалений

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

@ -54,13 +54,16 @@ CanvasBrowser.prototype = {
_screenY: 0,
get canvasDimensions() {
return [this.canvasRect.width, this.canvasRect.height];
if (!this._canvasRect) {
let canvasRect = this._canvas.getBoundingClientRect();
this._canvasRect = {
width: canvasRect.width,
height: canvasRect.height
}
}
return [this._canvasRect.width, this._canvasRect.height];
},
get canvasRect() {
return this._canvas.getBoundingClientRect();
},
get _effectiveCanvasDimensions() {
return this.canvasDimensions.map(this._screenToPage, this);
},
@ -429,8 +432,9 @@ CanvasBrowser.prototype = {
// Need to adjust for the deckbrowser not being at 0,0
// (e.g. due to other browser UI)
let clickOffsetX = this._screenToPage(aClientX - this.canvasRect.left) + this._pageX;
let clickOffsetY = this._screenToPage(aClientY - this.canvasRect.top) + this._pageY;
let canvasRect = this._canvas.getBoundingClientRect();
let clickOffsetX = this._screenToPage(aClientX - canvasRect.left) + this._pageX;
let clickOffsetY = this._screenToPage(aClientY - canvasRect.top) + this._pageY;
// Take scroll offset into account to return coordinates relative to the viewport
let cwin = this._browser.contentWindow;