-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #9126 +/- ##
===========================================
- Coverage 73.18% 73.16% -0.02%
===========================================
Files 446 446
Lines 45661 45665 +4
Branches 3907 3908 +1
===========================================
- Hits 33418 33412 -6
- Misses 12243 12253 +10
|
PR description is not really clear, as |
Updated description added some links to code. My bad, it was not a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Motivation and context
Currently we have such a problem:

The issue occurs when applying an image filter. The bug follows these steps:
canvasInstance.setup()
.canvasModel.setup()
after gettingframeData.data()
,canvas.fit()
is called (likely to maintain zoom and position even when switching to an image with a different resolution).canvas.fit()
dispatches acanvas.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 insidecanvasModel.setup()
, as inside of it we need to reset the scale to base parameters before adjusting it withrelativeScaling
How has this been tested?
Checklist
develop
branch[ ] I have updated the documentation accordingly[ ] I have added tests to cover my changes[ ] I have linked related issues (see GitHub docs)License
Feel free to contact the maintainers if that's a concern.