2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Graphics function AndRectRegion()
8 #include "graphics_intern.h"
9 #include <graphics/regions.h>
10 #include <proto/exec.h>
11 #include <clib/macros.h>
12 #include "intregions.h"
14 /*****************************************************************************
17 #include <proto/graphics.h>
19 AROS_LH2(struct Region
*, AndRectRegionND
,
22 AROS_LHA(struct Region
*, Reg
, A0
),
23 AROS_LHA(struct Rectangle
*, Rect
, A1
),
26 struct GfxBase
*, GfxBase
, 107, Graphics
)
29 Remove everything inside 'region' that is outside 'rectangle'
32 region - pointer to Region structure
33 rectangle - pointer to Rectangle structure
36 The resulting region or NULL in case there's no enough free memory
43 AndRegionRegion(), OrRectRegion(), XorRectRegion(), ClearRectRegion()
49 27-11-96 digulla automatically created from
50 graphics_lib.fd and clib/graphics_protos.h
51 16-01-97 mreckt initial version
53 *****************************************************************************/
61 /* Is the region empty? */
62 !Reg
->RegionRectangle
||
64 /* Does the rectangle completely cover the region? */
65 Rect
->MinX
<= MinX(Reg
) &&
66 Rect
->MinY
<= MinY(Reg
) &&
67 Rect
->MaxX
>= MaxX(Reg
) &&
68 Rect
->MaxY
>= MaxY(Reg
)
72 return CopyRegion(Reg
);
79 struct RegionRectangle rr
;
96 &Res
->RegionRectangle
,
102 _TranslateRegionRectangles(Res
->RegionRectangle
, -MinX(Res
), -MinY(Res
));
114 } /* AndRectRegion */