-
-
Notifications
You must be signed in to change notification settings - Fork 890
Open
Description
Version
10.0.0-beta1
Steps to Reproduce
- Create an overlay with mode: 'weak_magnet'
- Draw near a candle but slightly above the high
- Observe that it doesn't snap to the high value
Current Behavior
Point doesn't snap
Expected Behavior
Point should snap to the nearest OHLC value when within modeSensitivity pixels
Environment
- OS:
- Browser:
- Framework:Any additional comments?
In the source code around line 8748-8762, the weak_magnet logic
subtracts modeSensitivity instead of adding it when checking
if the cursor is close enough to snap:
// When value > high:
var buffValue = yAxis.convertFromPixel(highY - modeSensitivity);
// This makes buffValue HIGHER than high, so the condition
// "value < buffValue" is rarely true
// Should probably be:
var buffValue = yAxis.convertFromPixel(highY + modeSensitivity);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels