From eb31b45aafbe01c3dae886ef102802aa2f24ccd3 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Mon, 13 Jan 2014 23:25:17 +0000 Subject: [PATCH] Fix MouseCursorMonitorMac to return correct hotspot position. Previusly (0, 0) was always return as mouse cursor hotspot. BUG=2779 R=wu@webrtc.org Review URL: https://webrtc-codereview.appspot.com/7089004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5379 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm b/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm index 0da9869242..46d2a8d1ee 100644 --- a/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm +++ b/webrtc/modules/desktop_capture/mouse_cursor_monitor_mac.mm @@ -158,8 +158,8 @@ void MouseCursorMonitorMac::CaptureImage() { DesktopSize size(nssize.width, nssize.height); NSPoint nshotspot = [nscursor hotSpot]; DesktopVector hotspot( - std::min(0, std::max(size.width(), static_cast(nshotspot.x))), - std::min(0, std::max(size.height(), static_cast(nshotspot.y)))); + std::max(0, std::min(size.width(), static_cast(nshotspot.x))), + std::max(0, std::min(size.height(), static_cast(nshotspot.y)))); CGImageRef cg_image = [nsimage CGImageForProposedRect:NULL context:nil hints:nil]; if (!cg_image)