Skip to content

Commit d7238a6

Browse files
Fix capture region x,y offset when DPI scaling on Windows (#131)
1 parent dcb1871 commit d7238a6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/win32/screengrab.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ MMRect getScaledRect(MMRect input)
1616
double scaleX = (double)(desktopWidth / (double)scaledDesktopWidth);
1717
double scaleY = (double)(desktopHeight / (double)scaledDesktopHeight);
1818

19-
return MMRectMake(input.origin.x, input.origin.y, input.size.width / scaleX, input.size.height / scaleY);
19+
return MMRectMake(
20+
input.origin.x / scaleX,
21+
input.origin.y / scaleY,
22+
input.size.width / scaleX,
23+
input.size.height / scaleY
24+
);
2025
}
2126

2227
MMBitmapRef copyMMBitmapFromDisplayInRect(MMRect rect)

0 commit comments

Comments
 (0)