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(RotateTool.js): evaluation of initialRotation #1461

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wang0122xl
Copy link

@wang0122xl wang0122xl commented Jan 25, 2022

fix: RotateTool rotate too quick when viewport.initialRotation is 0

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Bug fix

  • What is the current behavior? (You can also link to an open issue here)
    RotateTool rotate too quick when viewport.initialRotation is 0

  • What is the new behavior (if this is a feature change)?
    rotate normally

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    No

  • Other information:

fix: RotateTool rotate too quick when viewport.initialRotation is 0
@codecov
Copy link

codecov bot commented Jan 25, 2022

Codecov Report

Merging #1461 (75ea421) into master (95c3b7c) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1461   +/-   ##
=======================================
  Coverage   20.16%   20.16%           
=======================================
  Files         287      287           
  Lines       10102    10102           
  Branches     2060     2060           
=======================================
  Hits         2037     2037           
  Misses       6852     6852           
  Partials     1213     1213           
Impacted Files Coverage Δ
src/tools/RotateTool.js 16.66% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95c3b7c...75ea421. Read the comment docs.

@LaurentTrk
Copy link

Hi !
I ran into the same problem.
The recent change introduced in the 5.2.0 release has been made on purpose : Fix RotateTool on mobile devices (#1385) (cdf23b5).

Checking for undefined should preserved both attended behaviours :

  const initialRotation = viewport.initialRotation !== undefined
    ? viewport.initialRotation
    : viewport.rotation;

Hope it helps 🙏

For those needing the fix urgently, you can use a custom strategy with the RotateTool.

@wang0122xl
Copy link
Author

@LaurentTrk Thx, I just made a new commit including the condition of undefined.

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

Successfully merging this pull request may close these issues.

2 participants