зеркало из https://github.com/mozilla/pjs.git
We can't cache the canvas's top/left as they will change depending on where you are on the page
This commit is contained in:
Родитель
b6c88381dd
Коммит
6458fd420c
|
@ -58,16 +58,7 @@ CanvasBrowser.prototype = {
|
|||
},
|
||||
|
||||
get canvasRect() {
|
||||
if (!this._canvasRect) {
|
||||
let canvasRect = this._canvas.getBoundingClientRect();
|
||||
this._canvasRect = {
|
||||
width: canvasRect.width,
|
||||
height: canvasRect.height,
|
||||
left: canvasRect.left,
|
||||
top: canvasRect.top
|
||||
}
|
||||
}
|
||||
return this._canvasRect;
|
||||
return this._canvas.getBoundingClientRect();
|
||||
},
|
||||
|
||||
get _effectiveCanvasDimensions() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче