diff options
Diffstat (limited to 'source/gameengine/BlenderRoutines')
-rw-r--r-- | source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp index 40775f0355b..d563a17fe06 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp @@ -117,6 +117,11 @@ SetViewPort( int x1, int y1, int x2, int y2 ){ + /* x1 and y1 are the min pixel coordinate (e.g. 0) + x2 and y2 are the max pixel coordinate + the width,height is calculated including both pixels + therefore: max - min + 1 + */ int vp_width = (x2 - x1) + 1; int vp_height = (y2 - y1) + 1; int minx = m_frame_rect.GetLeft(); @@ -134,6 +139,8 @@ SetViewPort( void KX_BlenderCanvas::SetMouseState(RAS_MouseState mousestate) { + m_mousestate = mousestate; + switch (mousestate) { case MOUSE_INVISIBLE: @@ -166,7 +173,7 @@ void KX_BlenderCanvas::SetMousePosition(int x,int y) int winY = m_frame_rect.GetBottom(); int winH = m_frame_rect.GetHeight(); - BL_warp_pointer(m_win, winX + x, winY + (winH-y-1)); + BL_warp_pointer(m_win, winX + x, winY + (winH-y)); } |