Buggy code:
void drawBitmapMask ( Image srcImage , int srcColor , int srcMask , int srcX , int srcY , int srcWidth , int srcHeight , int destX , int destY , int destWidth , int destHeight , boolean simple , int imgWidth , int imgHeight , boolean offscreen ) { } void drawBitmapTransparent ( Image srcImage , int srcX , int srcY , int srcWidth , int srcHeight , int destX , int destY , int destWidth , int destHeight , boolean simple , BITMAP bm , int imgWidth , int imgHeight ) { } void drawBitmap ( Image srcImage , int srcX , int srcY , int srcWidth , int srcHeight , int destX , int destY , int destWidth , int destHeight , boolean simple , BITMAP bm , int imgWidth , int imgHeight ) { } public void drawLine ( int x1 , int y1 , int x2 , int y2 ) { } public void drawOval ( int x , int y , int width , int height ) { } public void drawPath ( Path path ) { } public void drawPoint ( int x , int y ) { } public void drawPolygon ( int [ ] pointArray ) { } public void drawPolyline ( int [ ] pointArray ) { } public void drawRectangle ( int x , int y , int width , int height ) { } public void drawRectangle ( Rectangle rect ) { } public void drawRoundRectangle ( int x , int y , int width , int height , int arcWidth , int arcHeight ) { } void drawRoundRectangleGdip ( int gdipGraphics , int pen , int x , int y , int width , int height , int arcWidth , int arcHeight ) { } public void drawString ( String string , int x , int y ) { } public void drawString ( String string , int x , int y , boolean isTransparent ) { } public void drawText ( String string , int x , int y ) { } public void drawText ( String string , int x , int y , boolean isTransparent ) { } public void drawText ( String string , int x , int y , int flags ) { } public boolean equals ( Object object ) { } public void fillArc ( int x , int y , int width , int height , int startAngle , int arcAngle ) { } public void fillGradientRectangle ( int x , int y , int width , int height , boolean vertical ) { } public void fillOval ( int x , int y , int width , int height ) { } public void fillPath ( Path path ) { } public void fillPolygon ( int [ ] pointArray ) { } public void fillRectangle ( int x , int y , int width , int height ) { } public void fillRectangle ( Rectangle rect ) { } public void fillRoundRectangle ( int x , int y , int width , int height , int arcWidth , int arcHeight ) { } void fillRoundRectangleGdip ( int gdipGraphics , int brush , int x , int y , int width , int height , int arcWidth , int arcHeight ) { } void flush ( ) { } public int getAdvanceWidth ( char ch ) { } public boolean getAdvanced ( ) { } public int getAlpha ( ) { } public int getAntialias ( ) { } public Color getBackground ( ) { } public Pattern getBackgroundPattern ( ) { } public int getCharWidth ( char ch ) { } public Rectangle getClipping ( ) { } public void getClipping ( Region region ) { if ( ( handle ) == 0 ) SWT . error ( ERROR_GRAPHIC_DISPOSED ) ; if ( region == null ) SWT . error ( ERROR_NULL_ARGUMENT ) ; if ( region . isDisposed ( ) ) SWT . error ( ERROR_INVALID_ARGUMENT ) ; int gdipGraphics = data . gdipGraphics ; if ( gdipGraphics != 0 ) { Gdip . Graphics_SetPixelOffsetMode ( gdipGraphics , PixelOffsetModeNone ) ; int rgn = Gdip . Region_new ( ) ; Gdip . Graphics_GetClip ( data . gdipGraphics , rgn ) ; if ( Gdip . Region_IsInfinite ( rgn , gdipGraphics ) ) { Rect rect = new Rect ( ) ; Gdip . Graphics_GetVisibleClipBounds ( gdipGraphics , rect ) ; <START_BUG> OS . SetRectRgn ( region . handle , rect . X , rect . Y , rect . Width , rect . Height ) ; <END_BUG> } else { int matrix = Gdip . Matrix_new ( 1 , 0 , 0 , 1 , 0 , 0 ) ; int identity = Gdip . Matrix_new ( 1 , 0 , 0 , 1 , 0 , 0 ) ; Gdip . Graphics_GetTransform ( gdipGraphics , matrix ) ; Gdip . Graphics_SetTransform ( gdipGraphics , identity ) ; int hRgn = Gdip . Region_GetHRGN ( rgn , data . gdipGraphics ) ; Gdip . Graphics_SetTransform ( gdipGraphics , matrix ) ; Gdip . Matrix_delete ( identity ) ; Gdip . Matrix_delete ( matrix ) ; OS . CombineRgn ( region . handle , hRgn , 0 , RGN_COPY ) ; OS . DeleteObject ( hRgn ) ; } Gdip . Region_delete ( rgn ) ; Gdip . Graphics_SetPixelOffsetMode ( gdipGraphics , PixelOffsetModeHalf ) ; return ; } POINT pt = new POINT ( ) ; if ( ! ( OS . IsWinCE ) ) OS . GetWindowOrgEx ( handle , pt ) ; int result = OS . GetClipRgn ( handle , region . handle ) ; if ( result != 1 ) { RECT rect = new RECT ( ) ; OS . GetClipBox ( handle , rect ) ; OS . SetRectRgn ( region . handle , rect . left , rect . top , rect . right , rect . bottom ) ; }

Fix:
OS . SetRectRgn ( region . handle , rect . X , rect . Y , ( ( rect . X ) + ( rect . Width ) ) , ( ( rect . Y ) + ( rect . Height ) ) ) ;