Skip to content

Commit

Permalink
Debugger: Sprite Viewer - Fixed mouse over/click when DPI > 100% and …
Browse files Browse the repository at this point in the history
…"show offscreen regions" is unchecked
  • Loading branch information
SourMesen committed Jul 23, 2023
1 parent 2822ca5 commit 00c71cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions UI/Debugger/Controls/PictureViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,11 @@ protected override void OnPointerPressed(PointerPressedEventArgs e)

public PixelPoint? GetGridPointFromMousePoint(Point p)
{
p = new Point(p.X + LeftClipSize * Zoom, p.Y + TopClipSize * Zoom);
double leftClip = LeftClipSize * Zoom / LayoutHelper.GetLayoutScale(this);
double topClip = TopClipSize * Zoom / LayoutHelper.GetLayoutScale(this);
p = new Point(p.X + leftClip, p.Y + topClip);

if(p.X < 0 || p.Y < 0 || p.X >= MinWidth + LeftClipSize * Zoom || p.Y >= MinHeight + TopClipSize * Zoom) {
if(p.X < 0 || p.Y < 0 || p.X >= MinWidth + leftClip || p.Y >= MinHeight + topClip) {
return null;
}

Expand Down

0 comments on commit 00c71cc

Please sign in to comment.