Browse Source

issue with XClearArea and 0-width areas

David Rose 16 years ago
parent
commit
23ab03ec91
1 changed files with 12 additions and 4 deletions
  1. 12 4
      direct/src/plugin/p3dX11SplashWindow.cxx

+ 12 - 4
direct/src/plugin/p3dX11SplashWindow.cxx

@@ -722,10 +722,18 @@ redraw() {
 
 
     // Then clear the rectangles around it carefully (rather than just
     // Then clear the rectangles around it carefully (rather than just
     // clearing the whole window first, to avoid flicking).
     // clearing the whole window first, to avoid flicking).
-    XClearArea(_display, _window, 0, 0, _win_width, yo, False);
-    XClearArea(_display, _window, 0, yo, xo, _composite_height, False);
-    XClearArea(_display, _window, _win_width - xo, yo, xo, _composite_height, False);
-    XClearArea(_display, _window, 0, _win_height - yo, _win_width, yo, False);
+    if (yo != 0 && _win_width != 0) {
+      // Top
+      XClearArea(_display, _window, 0, 0, _win_width, yo, False);
+      // Bottom
+      XClearArea(_display, _window, 0, _win_height - yo, _win_width, yo, False);
+    }
+    if (xo != 0 && _composite_height != 0) {
+      // Left
+      XClearArea(_display, _window, 0, yo, xo, _composite_height, False);
+      // Right
+      XClearArea(_display, _window, _win_width - xo, yo, xo, _composite_height, False);
+    }
   }
   }
 }
 }