Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Dashboard/Helpers/ChartHoverHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ private void OnMouseMove(object sender, MouseEventArgs e)
try
{
var pos = e.GetPosition(_chart);
var dpi = VisualTreeHelper.GetDpi(_chart);
var pixel = new ScottPlot.Pixel(
(float)(pos.X * _chart.DisplayScale),
(float)(pos.Y * _chart.DisplayScale));
(float)(pos.X * dpi.DpiScaleX),
(float)(pos.Y * dpi.DpiScaleY));
var mouseCoords = _chart.Plot.GetCoordinates(pixel);

/* Use X-axis (time) proximity as the primary filter, Y-axis distance
Expand Down
5 changes: 3 additions & 2 deletions Lite/Helpers/ChartHoverHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ private void OnMouseMove(object sender, MouseEventArgs e)
_lastUpdate = now;

var pos = e.GetPosition(_chart);
var dpi = VisualTreeHelper.GetDpi(_chart);
var pixel = new ScottPlot.Pixel(
(float)(pos.X * _chart.DisplayScale),
(float)(pos.Y * _chart.DisplayScale));
(float)(pos.X * dpi.DpiScaleX),
(float)(pos.Y * dpi.DpiScaleY));
var mouseCoords = _chart.Plot.GetCoordinates(pixel);

double bestDistance = double.MaxValue;
Expand Down
Loading