question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

during panning, editor does not follow mouse cursor when it's outside of the element

See original GitHub issue

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jerosolercommented, May 31, 2022

Wow! Work correct! 😉

I did not know this method. It is very simple to implement:

    editor.pointerdown = (e) => {
        editor.container.onpointermove = editor.position(e);
        editor.container.setPointerCapture(e.pointerId);
    } 
    editor.pointerup = (e) => {
        editor.container.onpointermove = null;
        editor.container.releasePointerCapture(e.pointerId);
    } 

    editor.container.addEventListener('pointerdown', editor.pointerdown);
    editor.container.addEventListener('pointerup', editor.pointerup); 
0reactions
jerosolercommented, Oct 24, 2022

so why are we nulling out editor.container.onpointermove?

It is passed to null. Because once the mouse is up there is no reason to pass the position function.

You can see more at https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture

Read more comments on GitHub >

github_iconTop Results From Across the Web

Zoom/scale at mouse position - javascript - Stack Overflow
Use the canvas for zoomable content. Zooming and panning elements is very problematic. It can be done but the list of issues is...
Read more >
cursor - CSS: Cascading Style Sheets - MDN Web Docs
The cursor CSS property sets the mouse cursor, if any, to show when the mouse pointer is over an element.
Read more >
ArcGIS Mouse Cursor Stuck in Auto Pan / Continuous Zoom ...
I have been having this issue, and as a short term solution: make sure the cursor mode you would like to use is...
Read more >
Pointer Events - W3C
A pointer can be any point of contact on the screen made by a mouse cursor, pen, touch (including multi-touch), or other pointing...
Read more >
How to use pan and zoom effects in Premiere Elements.
The Pan and Zoom tool follows the 'Z' pattern while detecting and creating sequences for recognized faces. Select Reverse Automatic Panning ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found