Propeller icon indicating copy to clipboard operation
Propeller copied to clipboard

Rotation bug if target element or parent as position:fixed.

Open Paupy opened this issue 11 years ago • 1 comments

If the element or his parent is in position: fixed, the rotation doesn't work fine when you scroll. For fix, you have to use clientX and clientY here instead of pageX and pageY:

p.onRotated = function (event) {
    if (this.active === true) {
        event.stopPropagation();
        event.preventDefault();

        if (event.touches !== undefined && event.touches[0] !== undefined) {

            this.lastMouseEvent = {
                pageX: event.touches[0].clientX,
                pageY: event.touches[0].clientY
            }
        } else {
            this.lastMouseEvent = {
                pageX: event.clientX,
                pageY: event.clientY
            }
        }
    }
}

Paupy avatar Sep 18 '14 02:09 Paupy

Hi, sorry for late answer and thanks for the fix proposed, will check and add it asap, you may create a pull request if possible

PixelsCommander avatar Nov 08 '14 23:11 PixelsCommander