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/remaining issues camera inside terrain #4551

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

chrneumann
Copy link
Contributor

@chrneumann chrneumann commented Aug 13, 2024

Launch Checklist

Add buffer so that camera doesn't sit directly on terrain. Prevent crashes when zoom is wrongly calculated.

  • 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.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 87.78%. Comparing base (4d8a0f8) to head (9940ea5).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/geo/projection/mercator_transform.ts 55.55% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4551      +/-   ##
==========================================
- Coverage   87.87%   87.78%   -0.09%     
==========================================
  Files         265      265              
  Lines       37577    37589      +12     
  Branches     2349     2352       +3     
==========================================
- Hits        33020    32999      -21     
- Misses       3518     3549      +31     
- Partials     1039     1041       +2     

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

src/geo/transform.ts Outdated Show resolved Hide resolved
@HarelM
Copy link
Collaborator

HarelM commented Aug 24, 2024

@chrneumann where are we with this?

@chrneumann
Copy link
Contributor Author

@chrneumann where are we with this?

Waiting for your reply, see the open code review.

@HarelM
Copy link
Collaborator

HarelM commented Aug 24, 2024

Hu?
Can you link to it?

@chrneumann
Copy link
Contributor Author

chrneumann commented Aug 28, 2024

@HarelM
Copy link
Collaborator

HarelM commented Aug 28, 2024

Are you sure you have submitted your response?
This is what I see on my side:
image

@chrneumann
Copy link
Contributor Author

Are you sure you have submitted your response?

Ok, sorry, I did not submit the review.

@HarelM
Copy link
Collaborator

HarelM commented Sep 14, 2024

Ok, looks good, can you check why the test is failing?

@chrneumann
Copy link
Contributor Author

Ok, looks good, can you check why the test is failing?

Fixed that, a render test failed because of the readded buffer between terrain surface and camera.

@HarelM
Copy link
Collaborator

HarelM commented Sep 19, 2024

Should this PR still be in draft mode?

@chrneumann chrneumann marked this pull request as ready for review September 19, 2024 16:29
@HarelM
Copy link
Collaborator

HarelM commented Sep 19, 2024

Can you please add a changelog entry?

@chrneumann
Copy link
Contributor Author

Done. New transform stuff also merged.

src/geo/transform.ts Outdated Show resolved Hide resolved
@HarelM
Copy link
Collaborator

HarelM commented Sep 30, 2024

Looking at the fact that you added code without a failing test can indicate that the added code in the transform class is not covered by tests?

@chrneumann
Copy link
Contributor Author

Yes, the try/catch is not covered by a test. We talked about that before: #4551 (comment) Best would be to have more insights from someone who knows more about the recalculation code. Not sure, if you got a reply? But yeah, I could also try to crash it and find out which values lead to the crash and add a test with these values. But knowing why it crashes in the first place would be better.

@HarelM
Copy link
Collaborator

HarelM commented Oct 1, 2024

Did you push the commit? I still see that the code coverage is not getting to this catch block...

@chrneumann
Copy link
Contributor Author

No, did you see the discussion at #4551 (comment) ?

@HarelM
Copy link
Collaborator

HarelM commented Oct 1, 2024

Yes, regardless of if the solution is an "if" or a try-catch, there's a need to add a test the reproduces this issue (I think a unit test is the right kind of test here, but I don't mind either way).
Once you have a scenario that can be reproduced we can better talk about the solution, I believe.

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.

4 participants