mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-14 08:43:12 +00:00
Also consider CSS transforms when handling mouse.
This commit is contained in:
parent
d5f948877c
commit
dc6e53288c
1 changed files with 2 additions and 2 deletions
|
|
@ -811,8 +811,8 @@
|
|||
getPointer: function (e) {
|
||||
var pointer = getPointer(e, this.upperCanvasEl);
|
||||
var cssScale = {
|
||||
width: this.upperCanvasEl.width / this.upperCanvasEl.offsetWidth,
|
||||
height: this.upperCanvasEl.height / this.upperCanvasEl.offsetHeight,
|
||||
width: this.upperCanvasEl.width / this.upperCanvasEl.getBoundingClientRect().width,
|
||||
height: this.upperCanvasEl.height / this.upperCanvasEl.getBoundingClientRect().height,
|
||||
}
|
||||
return {
|
||||
x: (pointer.x - this._offset.left) * cssScale.width,
|
||||
|
|
|
|||
Loading…
Reference in a new issue