Skip to content

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

@Paupy

Description

@Paupy

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
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions