From 0bb6f3497d0f011458823b369f6d6cb84a914c36 Mon Sep 17 00:00:00 2001 From: Nicolas Bacca Date: Mon, 21 Jul 2003 12:50:20 +0000 Subject: Fix 774982 svn-id: r9107 --- backends/wince/wince.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'backends/wince') diff --git a/backends/wince/wince.cpp b/backends/wince/wince.cpp index 100a339ba4..ab12d86559 100644 --- a/backends/wince/wince.cpp +++ b/backends/wince/wince.cpp @@ -1445,6 +1445,26 @@ void OSystem_WINCE3::copy_rect(const byte *buf, int pitch, int x, int y, int w, if (!hide_cursor && _mouse_drawn) undraw_mouse(); + /* Clip */ + if (x < 0) { + w += x; + buf -= x; + x = 0; + } + if (y < 0) { + h += y; + buf -= y * pitch; + y = 0; + } + if (w > _screenWidth - x) + w = _screenWidth - x; + + if (h > _screenHeight - y) + h = _screenHeight - y; + + if (w <= 0 || h <= 0) + return; + AddDirtyRect(x, y, w, h); if (x == 0 && y == 0 && w == _screenWidth && h == _screenHeight) { -- cgit v1.2.3