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

Correct mouse position even when scaling the map using CSS #3437

Merged
merged 8 commits into from
Dec 4, 2023
Merged

Conversation

HarelM
Copy link
Member

@HarelM HarelM commented Dec 3, 2023

Fixes #1160

Replaces

The reason for changing to use canvas instead of canvas container for mouse positions is the following - the height of the container is 0, which doesn't allow to calculate the relative change in height.
image

  • 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 Dec 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f5cb922) 75.60% compared to head (44ab061) 75.61%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3437      +/-   ##
==========================================
+ Coverage   75.60%   75.61%   +0.01%     
==========================================
  Files         243      243              
  Lines       19163    19172       +9     
  Branches     4243     4246       +3     
==========================================
+ Hits        14488    14497       +9     
  Misses       4675     4675              

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

src/util/dom.ts Outdated Show resolved Hide resolved
src/util/dom.ts Outdated Show resolved Hide resolved
HarelM and others added 4 commits December 3, 2023 20:10
Co-authored-by: neodescis <nsteinbaugh@gmail.com>
Co-authored-by: neodescis <nsteinbaugh@gmail.com>
@HarelM HarelM enabled auto-merge (squash) December 4, 2023 06:22
@HarelM HarelM merged commit 6b248c5 into main Dec 4, 2023
14 checks passed
@HarelM HarelM deleted the fix-1160 branch December 4, 2023 06:28
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.

Mouse events are shifted after a css transform scale on the map container
3 participants