anthinkingcoder/vue-image-magnifier

Mouse move only shows bottom of image on zoom when scrolling

andreMariano90 opened this issue · 3 comments

To fix it you should change the
e.pageX and e.pageY of the handleMove function to e.clientX and e.clientY

ex:

handleMove: function (e) {
                this.maskX = this.outXCheck(e.clientX - this.imgRect.left);
                this.maskY = this.outYCheck(e.clientY - this.imgRect.top);
                this.zoomLeft = this.imgRect.width + 10;

                // 计算大图偏移量
                this.zoomPosition.x = this.maskX * (this.zoomImgWidth / this.imgRect.width);
                this.zoomPosition.y = this.maskY * (this.zoomImgHeight / this.imgRect.height);
            }

where can we change this code. beacuse we cannot change it in node module. please reply

To fix it you should change the
e.pageX and e.pageY of the handleMove function to e.clientX and e.clientY

ex:

handleMove: function (e) {
                this.maskX = this.outXCheck(e.clientX - this.imgRect.left);
                this.maskY = this.outYCheck(e.clientY - this.imgRect.top);
                this.zoomLeft = this.imgRect.width + 10;

                // 计算大图偏移量
                this.zoomPosition.x = this.maskX * (this.zoomImgWidth / this.imgRect.width);
                this.zoomPosition.y = this.maskY * (this.zoomImgHeight / this.imgRect.height);
            }

thank you, i will be fix it

where can we change this code. beacuse we cannot change it in node module. please reply
fork it