Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] getCoordsWithinElement in navcubeplugin not working with page scroll. #199

Open
siem4 opened this issue Dec 4, 2024 · 0 comments
Open

Comments

@siem4
Copy link

siem4 commented Dec 4, 2024

Recently(last month) the scrolling of page offset and getting coords within the viewer was changed but this was forgotten in the navcubeplugin. Therefore the navcube did not change and therefore does not respond well to scrolling and selecting within the navcube. Would it be possible to change to as per the other changes:

        function getCoordsWithinElement(event) {
            var coords = [0, 0];
            if (!event) {
                event = window.event;
                coords[0] = event.x;
                coords[1] = event.y;
            } else {
                var element = event.target;
                const rect = element.getBoundingClientRect();

                coords[0] = event.clientX - rect.left;
                coords[1] = event.clientY - rect.top;
            }
            return coords;
        }
@siem4 siem4 changed the title [FIX] getCoordsWithinElement in navcubeplugin nog working with page scroll. [FIX] getCoordsWithinElement in navcubeplugin not working with page scroll. Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant