fix: round preview coordinates to avoid infinity updates#253
fix: round preview coordinates to avoid infinity updates#253jeetiss wants to merge 1 commit intoLouisBrunner:mainfrom
Conversation
|
|
Hi @jeetiss, I have seen this error many times for many different reasons. Do you have some test case that fails you can share with me? |
|
Hi @LouisBrunner! it is so hard to reproduce this error, i have logs for my previous reproduction,
preview works fine and then for some reason it going mad and swaps Rounding is the lightest fix, do you think it should be fixed in some other way? |
Could you give me an example on how you use
When I test it on my side, it never jumps unless the mouse move, which is why I am confused. This issue used to happen a lot in the past but the current implementation of
This is a pretty error-prone part of the codebase. It's been responsible for many bugs in the past so I would like to understand what's going on before patching anything. For example, if the value is jumping back and forth then it's probably not due to a floating-point error and thus it could also happen on whole number (e.g. oscillating between 81 and 82) in which case rounding wouldn't fix it. |




preview is throw error
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loopswhen dragged object has float coordinates or dimensionsrounding solves this problem