Implement SkiaDisplay::setMousePosition()

This commit is contained in:
David Capello 2015-05-22 12:14:45 -03:00
parent 73f4de1b5d
commit 237549b818
2 changed files with 8 additions and 0 deletions

View File

@ -121,6 +121,7 @@ bool SkiaDisplay::setNativeMouseCursor(NativeCursor cursor)
void SkiaDisplay::setMousePosition(const gfx::Point& position) void SkiaDisplay::setMousePosition(const gfx::Point& position)
{ {
m_window.setMousePosition(position);
} }
void SkiaDisplay::captureMouse() void SkiaDisplay::captureMouse()

View File

@ -87,6 +87,13 @@ namespace she {
m_captureMouse = false; m_captureMouse = false;
} }
void setMousePosition(const gfx::Point& position) {
POINT pos = { position.x * m_scale,
position.y * m_scale };
ClientToScreen(m_hwnd, &pos);
SetCursorPos(pos.x, pos.y);
}
void invalidate() { void invalidate() {
InvalidateRect(m_hwnd, NULL, FALSE); InvalidateRect(m_hwnd, NULL, FALSE);
} }