cornerstoneTools
cornerstoneTools copied to clipboard
fix(RotateTool.js): evaluation of initialRotation
fix: RotateTool rotate too quick when viewport.initialRotation is 0
- Please check if the PR fulfills these requirements
- [x] 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:
Codecov Report
Merging #1461 (75ea421) into master (95c3b7c) will not change coverage. The diff coverage is
0.00%
.
@@ 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.
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 :pray:
For those needing the fix urgently, you can use a custom strategy with the RotateTool.
@LaurentTrk Thx, I just made a new commit including the condition of undefined
.