Is there a fix for the crash issue when zooming while a script is set on the position changed event?

Is there a fix for the crash issue when zooming while a script is set on the position changed event? A way to disable the script while zooming would work fine for me. Would actually be better if I could just attach a script to the desktop and set the events in the code so I could have more control over the events and have global variables to reduce api calls. I’d assume that would be possible?

]]>

3 Commentsto Is there a fix for the crash issue when zooming while a script is set on the position changed event?

  1. Anonymous says:

    < ![CDATA[

    As I understood the issue appears because the script triggers a position change event inside the position change event itself, hence generating and endless loop (stack overflow).


    Try to break the loop this way:


    setTimeout(function() {


      your stuff here


    }, 0);


    It will be executed without delay, but in another cycle of the message loop, hence not recursively.

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Pierre Hébert Weird. Why does it trigger the event? I’m guessing that’s why it makes the scrolling really weird and accelerated. Well at least it doesn’t crash anymore.

    ]]>

  3. Anonymous says:

    < ![CDATA[

    This is a sum of side effects… The z-index change has for side effect to re-compute some data related to the bounds and current transformation (translate and scale, aka pan and zoom). It then has the effect to trigger a position changed event which was incorrectly filtered. Fixing that is not easy.

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *