-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fixed exception 'this.el.node.getScreenCTM() is null' when cancel drawing shape for any tracker #8080
Conversation
WalkthroughThe latest update introduces a fix for an exception related to canceling the drawing of shapes within trackers in the application. This is achieved by adding a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant InteractionHandlerImpl
participant Canvas
User->>InteractionHandlerImpl: Start drawing shape
InteractionHandlerImpl->>Canvas: Initialize drawing shape
User->>InteractionHandlerImpl: Cancel drawing shape
InteractionHandlerImpl->>InteractionHandlerImpl: Set cancelled to true
Canvas-->>InteractionHandlerImpl: Acknowledge cancellation
InteractionHandlerImpl-->>User: Drawing operation cancelled
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Quality Gate passedIssues Measures |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- changelog.d/20240625_125241_boris.md (1 hunks)
- cvat-canvas/src/typescript/interactionHandler.ts (5 hunks)
Files skipped from review due to trivial changes (1)
- changelog.d/20240625_125241_boris.md
Additional comments not posted (4)
cvat-canvas/src/typescript/interactionHandler.ts (4)
42-42
: Addition ofcancelled
property to manage interaction flowThe addition of the
cancelled
boolean property is a good approach to manage the state of drawing operations, especially to handle cancellations effectively. This change aligns with the PR's objective to fix the exception during shape drawing cancellation.
197-199
: Proper handling of thecancelled
state during rectangle interactionThis code ensures that if the interaction has been cancelled, no further processing occurs, which is crucial for avoiding unwanted side-effects after a cancellation event. This is a good use of the
cancelled
property to control the flow in theinteractRectangle
method.
542-563
: Management of interaction state based onenabled
propertyThe management of the
cancelled
state in response to theenabled
property ofinteractionData
is well-implemented. It ensures that when interaction is enabled, thecancelled
flag is reset, and the interaction setup is correctly initialized or continued based on the state ofinteractionData
.
592-592
: Effective use of thecancelled
property in thecancel
methodSetting the
cancelled
property to true in thecancel
method is straightforward and effectively communicates the intent to stop any ongoing interactions. This change supports the overall goal of managing drawing cancellations properly.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8080 +/- ##
===========================================
+ Coverage 83.64% 83.66% +0.02%
===========================================
Files 383 383
Lines 40439 40448 +9
Branches 3815 3819 +4
===========================================
+ Hits 33825 33841 +16
+ Misses 6614 6607 -7
|
Motivation and context
How has this been tested?
Checklist
develop
branch(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.
Summary by CodeRabbit