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

Fixed deltaPoints always 0 bug #1471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhangjindong
Copy link

@zhangjindong zhangjindong commented Apr 15, 2022

Fixed deltaPoints always 0 bug

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Bug fix

  • What is the current behavior? (You can also link to an open issue here)

I don't think currentPoints and lastPoints will be different when the mouse moves. I get deltaPoints. Image always {x:0,y:0}.

  • What is the new behavior (if this is a feature change)?

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Such as:

constructor(props = {}) {
    ...
    this.updateOnMouseMove = true;
    ...
}

// When I move the mouse quickly, I need to decide whether to hide when I reach the boundary.
mouseMoveCallback(evt) {
    const { element, currentPoints, image, deltaPoints } = evt.detail;
    const borderDistance = 30;
    const imageRect = {
    left: 0 + borderDistance - deltaPoints.image.x * 2,
    top: 0 + borderDistance - deltaPoints.image.y * 2,
    width: image.width - borderDistance * 2 - deltaPoints.image.x * 2,
    height: image.height - borderDistance * 2 - deltaPoints.image.y * 2,
    };
    ...
        const outside = cornerstoneMath.point.insideRect(data.handles.end, imageRect) === false;
        data.visible = ! outside;
    ...
}

  • Other information:

Fixed deltaPoints always 0 bug
@codecov
Copy link

codecov bot commented Apr 15, 2022

Codecov Report

Merging #1471 (c216a33) into master (95c3b7c) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #1471      +/-   ##
==========================================
- Coverage   20.16%   20.16%   -0.01%     
==========================================
  Files         287      287              
  Lines       10102    10103       +1     
  Branches     2060     2060              
==========================================
  Hits         2037     2037              
- Misses       6852     6853       +1     
  Partials     1213     1213              
Impacted Files Coverage Δ
src/eventListeners/mouseEventListeners.js 3.84% <0.00%> (-0.04%) ⬇️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

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.

None yet

1 participant