-
Notifications
You must be signed in to change notification settings - Fork 5
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
Possible to have an arrow with no height #430
Comments
Good find! Here's the relevant code in ArrowObjectNode.ts that snaps the arrow to its minimum magnitude: const end = ( sign: 1 | -1 ) => {
const arrowLength = arrowObject.positionProperty.value.y - optic.positionProperty.value.y;
if ( Math.abs( arrowLength ) < SNAP_TO_MIN_MAGNITUDE ) {
const x = arrowObject.positionProperty.value.x;
const y = sign * Math.sign( arrowLength ) * SNAP_TO_MIN_MAGNITUDE;
arrowObject.positionProperty.value = new Vector2( x, y );
}
}; The problem line is: const y = sign * Math.sign( arrowLength ) * SNAP_TO_MIN_MAGNITUDE; When Fixed in the above commit. @KatieWoe please verify in master. Be sure to test with both mouse, touch, and keyboard dragging. If it looks OK, change label to "fixed-awaiting-deploy". |
It looks good on master with all three inputs. However, I will note that in the original dev test I was never able to do this with a mouse, and it seemed almost impossible with keyboard nav, so confirming those is a bit harder. |
Understood. I wanted you to test with mouse and keyboard to verify that the fix hadn't broken anything more general with drag handling of the arrows. |
Things looked ok from what I saw. |
Looks ok in dev.1 |
Device
iPad
OS
iPadOS 15.4.1
Browser
Safari
Problem Description
For phetsims/qa#798
If you drag the arrow to the middle line exactly, it doesn't jump to a taller value and seems to disappear. You can still grab it with touch by swiping over it. May be possible on other devices, but I've mostly seen it on iPad.
Visuals
The text was updated successfully, but these errors were encountered: