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 unwanted roll #5083 #5092

Merged
merged 20 commits into from
Nov 27, 2024
Merged

Fix unwanted roll #5083 #5092

merged 20 commits into from
Nov 27, 2024

Conversation

NathanMOlson
Copy link
Contributor

@NathanMOlson NathanMOlson commented Nov 21, 2024

Launch Checklist

Fix #5083.

Use spherical linear interpolation only when startRoll != endRoll. Otherwise, use linear interpolation of Euler angles.

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Write tests for all new functionality.
  • Add an entry to CHANGELOG.md under the ## main section.

@NathanMOlson NathanMOlson marked this pull request as draft November 21, 2024 18:09
src/ui/camera.test.ts Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.82%. Comparing base (985b657) to head (61cb696).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5092      +/-   ##
==========================================
+ Coverage   91.81%   91.82%   +0.01%     
==========================================
  Files         278      278              
  Lines       38318    38346      +28     
  Branches     6703     6704       +1     
==========================================
+ Hits        35181    35212      +31     
+ Misses       3004     3001       -3     
  Partials      133      133              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@NathanMOlson NathanMOlson changed the title add failing unit test to demonstrate #5083 Fix unwanted roll #5083 Nov 21, 2024
@NathanMOlson NathanMOlson marked this pull request as ready for review November 21, 2024 20:40
src/ui/camera.ts Outdated Show resolved Hide resolved
src/ui/map.ts Outdated Show resolved Hide resolved
src/ui/camera.test.ts Outdated Show resolved Hide resolved
tr.setRoll(eulerAngles.roll);
tr.setPitch(eulerAngles.pitch);
tr.setBearing(eulerAngles.bearing);
export function updateRotation(startRotation: quat, endRotation: quat, startEulerAngles: RollPitchBearing, endEulerAngles: RollPitchBearing, tr: ITransform, k: number, useSlerp: boolean) {
Copy link
Collaborator

@HarelM HarelM Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to define a type for this method to pass the parameters as there are many parameters now, too many for my taste...

@HarelM
Copy link
Collaborator

HarelM commented Nov 22, 2024

We've just migrated the code to vitest, I'm trying to figure out if the coverage reports is accurate.
Cc: @birkskyum

@birkskyum
Copy link
Member

We've just migrated the code to vitest, I'm trying to figure out if the coverage reports is accurate. Cc: @birkskyum

It appear to be reporting at least some code as Covered on main
https://app.codecov.io/gh/maplibre/maplibre-gl-js/blob/main/src%2Fdata%2Ffeature_position_map.ts

And uncovered in this PR
https://app.codecov.io/gh/maplibre/maplibre-gl-js/pull/5092/blob/src/data/feature_position_map.ts

Despite being identical

@HarelM
Copy link
Collaborator

HarelM commented Nov 23, 2024

The report comment is saying that there is a missing uploaded file (8 files instead of 9).
I'm rerunning the CI now, see if it will help.

@HarelM
Copy link
Collaborator

HarelM commented Nov 25, 2024

@NathanMOlson can you address the last code review comment so I can merge this and release a new version?

@HarelM
Copy link
Collaborator

HarelM commented Nov 26, 2024

We have recently updated the coverage reporter, I hope it's accurate, if so, the tests need to cover more of the new code.

@NathanMOlson
Copy link
Contributor Author

We have recently updated the coverage reporter, I hope it's accurate, if so, the tests need to cover more of the new code.

I don't think the coverage reporter is accurate. I believe the new code has 100% coverage.

Copy link
Collaborator

@HarelM HarelM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

@HarelM
Copy link
Collaborator

HarelM commented Nov 27, 2024

Coverage seems to work correctly (hopefully).

@HarelM HarelM merged commit 86ea129 into maplibre:main Nov 27, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map ends up with roll when rollEnabled=false
3 participants