Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Good catch! The problem was introduced during the migration from mxGraph.
Could you match the original mxGraph behavior? AFAIK,
this.currentAlphawas used if not nullish. See https://github.com/jgraph/mxgraph/blob/v4.2.2/javascript/src/js/handler/mxVertexHandler.js#L2019ℹ️ there is no need have a single commit with the initial implementation and the suggested change that would be forced pushed in the PR.
I will squash all commits when merging the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try to pull it off tomorrow but if I recall correctly from code in the mxGraph currentAlpha was null by deafult, in our case its 100 for some reason. I tried setting initial alpha to 0 but the rotation was still not working. I am sure the calculation in rotation function is badly calculated when setting new alpha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I will also check on my side (I am not sure that I will be able to do it during the week-end)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked all around this file and when declaring alpha the variable was derived from this.state.style.rotation. I logged the value of currentAlpha and this.style.rotation and they do have same values at the at but after I release there were 2 redrawHandle function calls where both style.rotation and currentAlpha was 0 (it should be 90 since i rotated for 90 deg). Confusing thing is the values are always the same but for some reason results differ. My assumption is that alpha is not set until we finish rotating while style.rotation properly updates while we rotate. This could cause this behaviour but im not sure.