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 issue scaling on image filter appication #9126

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

Conversation

klakhov
Copy link
Contributor

@klakhov klakhov commented Feb 20, 2025

Motivation and context

Currently we have such a problem:
issue-scale1

The issue occurs when applying an image filter. The bug follows these steps:

  1. Enabling an image filter triggers canvas.configure().
  2. Inside canvas.configure(), canvas.fit() is called (likely to maintain zoom and position even when switching to an image with a different resolution).
  3. canvas.fit() dispatches a canvas.fit event, which the issues component listens to. As a result, the issues component receives the default zoom, causing issue elements to appear larger than expected.

To fix this, I extracted the scale reset into a separate method. There's no need to dispatch the fit event inside canvas.configure(), as inside of it we need to reset the scale to base parameters before adjusting it with relativeScaling

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@klakhov klakhov added the ui/ux label Feb 20, 2025
@klakhov klakhov requested a review from bsekachev as a code owner February 20, 2025 08:32
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.83%. Comparing base (558a861) to head (c98b66a).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #9126   +/-   ##
========================================
  Coverage    73.83%   73.83%           
========================================
  Files          431      431           
  Lines        44807    44811    +4     
  Branches      3892     3893    +1     
========================================
+ Hits         33084    33087    +3     
- Misses       11723    11724    +1     
Components Coverage Δ
cvat-ui 77.53% <100.00%> (-0.01%) ⬇️
cvat-server 70.79% <ø> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants