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
This commit is contained in:
sergeyu@chromium.org 2014-01-13 23:25:17 +00:00
parent 3907c2e7e5
commit eb31b45aaf

View File

@ -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<int>(nshotspot.x))),
std::min(0, std::max(size.height(), static_cast<int>(nshotspot.y))));
std::max(0, std::min(size.width(), static_cast<int>(nshotspot.x))),
std::max(0, std::min(size.height(), static_cast<int>(nshotspot.y))));
CGImageRef cg_image =
[nsimage CGImageForProposedRect:NULL context:nil hints:nil];
if (!cg_image)