зеркало из https://github.com/mozilla/pjs.git
Fix silly mistake in the patch for bug 459170
This commit is contained in:
Родитель
6458fd420c
Коммит
70bb9b52c3
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче