Skip to content

Commit

Permalink
GimbalVideoControl: fix bug in getMousePosition
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlong13 committed Jan 3, 2025
1 parent 0a8dac8 commit efffc05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Controls/GimbalVideoControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -681,13 +681,13 @@ private void VideoBox_Click(object sender, EventArgs e)
{
x -= (VideoBox.Width - imageWidth) / 2;
x *= VideoBox.Width / imageWidth;
x = Math.Max(0, Math.Min(VideoBox.Width, x));
x = Math.Max(0, Math.Min(imageWidth, x));
}
if (imageHeight < VideoBox.Height)
{
y -= (VideoBox.Height - imageHeight) / 2;
y *= VideoBox.Height / imageHeight;
y = Math.Max(0, Math.Min(VideoBox.Height, y));
y = Math.Max(0, Math.Min(imageHeight, y));
}

return (2 * x / (double)imageWidth - 1, 2 * y / (double)imageHeight - 1);
Expand Down

0 comments on commit efffc05

Please sign in to comment.